I searched further on the internet and based on the sollution given at the source http://www.eggheadcafe.com/tutorials/aspnet/9ae03b00-69e9-465e-adb9-a5bcc222d161/sending-mail-using-systemnetmail.aspx , I wrote the following code which allows sending mail from yahoo or gmail servers through System.Net.Mail class:MailMessage mail = new MailMessage();mail.From = new MailAddress(fromEmail);mail.To.A
Last modified by Nicoleta Scrimint on 9/28/2011 5:27:57 AM
' Visual Basic Sample - Sending SMTP Authenticated E-mail
Private Sub SendEmail()
' Create a new MailMessage object and specify the "From" and "To" addresses
Dim message As New MailMessage("From email", "To Email", "Subject", "Body message")
Dim emailClient As New SmtpClient("smtp server")
Dim basicAuthenticationInfo As New System.Net.Networ
Last modified by Thomas Lee on 9/2/2010 4:16:24 PM
Anyone think they should make a constructor that takes a NetworkCredential as a parameter for the credentials?
Last modified by Slehan on 11/26/2009 3:36:10 PM
# MSDN Sample, recoded using PowerShell
# Thomas Lee - firstname.lastname@example.org
# Create from/to addresses
$from = New-Object system.net.mail.MailAddress "email@example.com"
$to = New-Object system.net.mail.MailAddress firstname.lastname@example.org
# Create Message
$message = new-object system.net.mail.MailMessage $from, $to
$message.Subject = "Using the SmtpClient class and PowerShe
Last modified by Thomas Lee on 11/8/2008 4:37:47 PM
.NET Framework Class LibrarySmtpClient ClassMembersNote: This class is new in the .NET Framework version 2.0.
Allows applications to send e-mail by using the Simple Mail Transfer Protocol (SMTP).
Namespace: System.Net.MailAssembly: System (in system.dll)SyntaxVisual Basic (Declaration)Public Class SmtpClientVisual Basic (Usage)Dim instance As SmtpClient
C#public class SmtpClientC++publi
Last modified by Microsoft on 7/23/2007 11:32:22 PM
Apparently  the SmtpClient class (at least as of .Net Framework 2.0) doesn't supply the fully-qualified domain name for the origination point of the Smtp message. This can cause some smtp servers to reject the message.
Last modified by cori on 5/4/2007 5:17:47 PM