Thursday, March 22, 2012

SmtpMail class & multipart mail

I am new to mailing programmatically. I have been searching in forums and on the web for a couple of weeks now, unsuccessfully to determine if I can send multipart email with smtpmail. I need to send email in both html and plain text format via .net (c#). The default will be an html message and I need to send plain text if the recipients mail client won't render html. I have seen this done in traditional asp but cannot find a bridge in .net. I have no knowledge of the capabilities of the recipients mail clients. This is not an attempt to spam. I am working for an accredited university to mail students information on their course material and student progress. Any help or direction will be most helpful.Hi,

Try as below :


Dim MM as New System.Web.Mail.MailMessage()
MM.BodyFormat = Mail.MailFormat.Text

For HTML format use :

MM.BodyFormat = Mail.MailFormat.Html

HTH
Thanks, but I need to know how to tell the client which format to use. If you know how to do that in .net I will be on the right track.

0 comments:

Post a Comment