.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Sending Digitally Signed emails using C#

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :.NET Framework
Hi All,

    I have a requirement of sending a digitally signed email using C#,ASP.net. I tried it several ways and atlast using ASPEmail and ASPEncrypt i was able to access certificate but iam getting the mail address as the name of the certificate holder. Iam unable to find how to read the email address from the certificate. Any support will be appreciated. Thanks in advance.
phani kumar ---help me out

View Complete Post

More Related Resource Links

smtp server 5.1 in xp not sending emails


hi iam using asp.net 2.0 with c#.net.

in my application when client completes its shopping email will goes to user this works fine when there is internet connection is working fine,
if  there is some problem  in internet connection if one mail stops then all the mails will be stopped even now internet works fine,

how to resend the emails using smtp server, is there any option to resend the emails automatically when internet works fine.

can you give example which helps me.

Sending Asynchronous emails from Asp.Net Web pages

Hey Guys, Here is my situation and hopefully someone could guide me in the right direction. I have a shared or static class in my website (App_Code folder) which has static methods to send emails asychronoulsy. So whenever there is an exception in any of my pages or classes I call these methods to send an email to support asynchronously. Now when there is an exception in a page, to route that exception asynchronously I need to have Async = "true" for that page. I have more than 50 pages and I don't want to set Async= "true" on every page as I read that it affects performance. So I was wondering if there is any way I could send emails asynchronously without having to set async = "true" on every page. Thanks for your time,   Uday.    

Error on sending Outlook emails

Hi,I am trying to send an email using Outlook in my application. When I run the application in my local machine , it works fine and sends the email using my outlook address. But when I depolyed it onto our server, which is a  Windows Server 2008, it throws an error:Description:            Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.Date/ time:            20100908_03:51:48FullErrorOutput:            System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.   at _Default.SendWelcomeEmails(String email)   at _Default.btnGrant_Command(Object sender, CommandEventArgs e)   at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)   at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)   at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)   a

sending bulk of emails


Hello guys

   I have a situation where i have to send around 50,000 emails with around 90kb attachment, each attachment will be generated by crystal reports then sent by email to the subscriber, what is the best practice for this? thanks alot

Get "Untrusted signature - the trust chain cannot be verified" while verifying digitally signed Info



Hi all,


I have browser-enabled InfoPath form that contains digital signature.

User can open this form in his browser, to fill it out and to sign it with his own key/certificate.

The signing process completes successfully,

but when this form is opened for verification, SP displays following message:


Untrusted signature - the trust chain cannot be verified.


The Root certificate of CA that issued user's certificate presents in Trusted Root Certification Authorities store on the SharePoint Server. When the same filled signed form is downloaded to the local file (on SharePoint server PC) and verified with InfoPath application, the signature is valid and verified successfully.


What am I missing and how SP-server verifies certifcation chain?


Thanks in advance,






Workflow keep sending emails!



i customized a workflow using SPD and attach it with a List, the trigger was when a specific item field changed, send an email.

the problem is the workflow keep sending the emails repeatedly . i deleted the list item, i even deleted the workflow itself from the Settings >> Workflow settings, i cleared the SPD workflow cashe, and it still sending the emails!

appreciate your help..

Sending Emails


Hi all.

I'm trying to solve a problem about sending emails from a contact form.  I have the first script that i'm using it sending but only to my external account and I got this on that sends but i'ts in vb and I'm not able to attach a style sheet to it. could any one tell me a code that I can use to replace the VB version.  Or. can translate the VB into C#

This will be appreciated.


this is my web config file
			<smtp from="send@myservices.com" deliveryMethod="Network">
				<network host="mail.myservice.com" port="25" userName="send@myservices.com" password="service" />

this is my C# backend code.

  protected void Button1_Click(object sender, EventArgs e)
            SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage(); try
                MailAddress fromAddress = new MailAddress(Email.Text.ToString(), this.Contname.Text.ToString());
                message.From = fromAddress;//here you can set address   

Testing Emails Sending (SMTP) under IIS7 Express (WebMatrix)


Hi there,

I don't have web server account yet so I must test my applications with the Web Development Server under VS 2010 with C# but I read that I couldn't send emails under that server but I also read that I can send email with IIS7 Express and that's the main reason why I've install Webmatrix. Maybe someone can confirm this.

So for the moment I am redirecting my emails into a local folder and it is working perfectly.

Here is part of the code I've add to the Web.Config for doing that.

      <smtp deliveryMethod="SpecifiedPickupDirectory">
        <specifiedPickupDirectory pickupDirectoryLocation="D:\Temp"/>


As you can see I am redirecting the emails to the D:\temp

The following code for sending emails comes 
from the videos of JOE STAGNER at Microsoft
but beware there is a few typing errors in 
his video like missing > " 


Sending emails to user from people picker - non-exchange user


Hi all another issue @ hand, our production environment is in co-existence between exchange and domino, mail flow is working fine between them as we do directory sync. now for the juicy part, when sending email notification from sharepoint, it users people picker to pick up users synced from AD. To Exchange users it goes through without issue, but to Domino users it does not, even though the AD account has the email field in account been tabulated. For Domino users we have AD account and Mail contact for mail fow. Can someone help me understand why is it so when even with the email field been tabulated in the AD accoutn for the Domino users, email notification does not go through, but when the email address of the users is hard-coded into the notification the email goes through.

SharePoint custom workflow sending duplicate task assigned emails


I'm running into an issue where a custom sequential workflow I've built in VS2010 is sometimes sending duplicate emails to the user to whom created tasks are assigned. Note: this is a Site workflow not a List workflow, in case that matters.

It's a pretty simple flow: i've got an InfoPath initiation form, and am using an OnWorkflowActivated workflow action to take the data from the form and popluate some workflow variables, then I've got a CreateTask workflow action that sets the AssignedTo value on the Task Properties, along with some other Task Property values.

The task gets created successfully in the task list, and in most cases a single email goes out to the person the task is assigned to. However, sometimes (and I haven't been able to figure out what is causing the difference) up to 3 duplicate messages are sent out, as well.

I've seen other posts in the forums where this sort of thing is happening with OOTB workflows ( this thread, for example: http://social.msdn.microsoft.com/Forums/en/sharepointworkflow/thread/66f94e07-a690-4166-aaeb-b7f5bc424fe4?prof=required). However, duplicate tasks are not being created (unless I'm missing the duplicates somehow -- they're not showing in the task li

How to send a digitally signed through C# code.


Hi Friends please help me.i m very stuck of this problem How to send a digitally signed through C# code.i apply the no of ways but still not able to perform.please help.its urgent

Sending a File Using Email Helper in WebPages/Razor


Note: This is particularly with respect to Email Helper in WebPages/Razor. Please don't post links using System.Net.Mail object.

Following this tutorial: http://www.asp.net/webmatrix/tutorials/9-adding-email-to-your-website

Under "Sending a File Using Email" section what exactly is the code trying to do.

1: The SendFile.cshtml does not have any option to select file.

2: ProcessFile.cshtml is running fine. I am getting the email but no attachement.

I tried changing fileAttachment input to type="file" but not file is being sent to my email. I just get the message send in body.

Question: How exactly this file attachment works using Email Helper in WebPages.

How do I get the emails of all the members of a given group in ActiveDirectory - Need help



  I have a need to send out emails to all the people who are in a given group say "HR Department". I need to be able to get all the emails through a for loop and then as it retrieves I should send emails to them. Can some one please help me with the code

this is what I came up with but not sure how to go about writing a for loop to get all the emails in the given group.

public static string SendEmails(string loginName)
        string Department = "HR Department"
        string userName = ExtractUserName(loginName);
        DirectorySearcher search = new DirectorySearcher();
        search.Filter = String.Format("(SAMAccountName={0})", userName);
        //search.Filter = String.Format("(SAMAccountName={FAY ImprovmentForm})", userName);
        //LdapSearcher.Filter = string.Format("(&(objectClass=user)(department={0}))", Department); 
        //search.Filter = string.Format("(&(objectClass=group)(SAMAccountName=" + Department + "))", userName);

DIME: Sending Files, Attachments, and SOAP Messages Via Direct Internet Message Encapsulation


Direct Internet Message Encapsulation (DIME) is a new specification for sending and receiving SOAP messages along with additional attachments, like binary files, XML fragments, and even other SOAP messages, using standard transport protocols like HTTP. In this article, the author explains what DIME is and how it differs from MIME encapsulation. A detailed description of the message format and how it is parsed, as well as working with SOAP and extending it with WSDL, is also included.

Jeannine Hall Gailey

MSDN Magazine December 2002

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend