This class sends a MimeMessage to an SMTP server
For a list of all members of this type, see SMTPClient Members.
System.Object
SmtPop.SMTPClient
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
This sample sends an e-mail
MimeMessage msg = new MimeMessage (); string body = "This is a simple message for test"; string subject = "A simple message for test"; MailAddressList from = new MailAddressList (); from.Add (new MailAddress ("toto <toto@toto.com>")); msg.AddressFrom = from; MailAddressList to = new MailAddressList (); to.Add (new MailAddress (TestConstant.toadr)); msg.AddressTo = to; msg.SaveAdr (); msg.SetSubject (subject, MimeTransferEncoding.Ascii7Bit); msg.SetBody (body, MimeTransferEncoding.Ascii7Bit, MimeTextContentType.TextPlain); SMTPClient smtp = new SMTPClient (TestConstant.host, TestConstant.portsmtp); smtp.Open (); smtp.SendMail (msg); smtp.Close ();
Namespace: SmtPop
Assembly: smtpop (in smtpop.dll)
SMTPClient Members | SmtPop Namespace