FAQ for Email Sending in ASP.NET

Email sending in ASP.NET is very easy! There's a library named "System.Web.Mail" provide a easy emailing services for ASP.NET Developers, we can prepare and send an email from our Web application in just 1-2 lines of codes. Moreover, Web Matrix provide a Code Wizard which contain a Email Sending module/wizard which will generate the code to send email in a visual way.

Well, What I want to say in this blog is that MikePope post a FAQ thread in the ASP.NET Forum last week, in which he had covered MOST of the query/question about email sending, it's compensive and cool! (view post)

The FAQ included:

  • How do I configure a local SMTP server?
  • Can I use a "friendly name" in the To and From properties?
  • How do I add an attachment to an email?
  • How can I determine if my email is being sent successfully?
  • Could not access 'CDO.Message' object.
  • 550 5.7.1 Unable to relay for xxxxx or 550 not local host xxxxx, not a gateway 
  • Can I specify authentication information as part of the email message in ASP.NET? 
  • ...

I'd like to highlight one of the FAQ , the last one - specify authentication information in sending email: Many people have its own email account from their ISP, while it mostly require a login/authentication in order to use it. However, the current MailMessage class doesn't provide this fucntion (yet?)... 
BUT, Dave's "AspNetEmail" do! You can specify a UserName/Password for server that require authentication to relay!

Honestly, I still don't have a chance to use this component as I don't have a licensed copy. However, I know my friends (ALowe and ScottW) have a pretty good experience for this product on ASPAdvice and his Blog application! :o)

3 Comments

  • nice FAQ ... can you add or point me some links where I can receive e-mail programatically !! It will be lot useful in


    my scnario, where I send message to a custom (cell) phone, the user replies to my messages, which I should be able to pick-up in my program (.Net)





    Thanks,


    Varadhg


  • I want to know, how to send email to all kinds of server? Currently, I'm facing problems sending to other mail server except it is the same server as mine. For example, I can't use my mail server to send to other server like hotmail or yahoo..

    Please help, thanx

  • Hi Tan Ming,



    Provided that the destination is a valid email account, we can use the System.Web.Mail to send out email to anyone by setting the ".To" field programmatically.

Comments have been disabled for this content.