Ricky White
asked on
How to send Email from a .Net project?
I would like to create a C#.Net project to send an email with an attachment.
Please advise how can this be achieved. Would VBScript be the easiest route?
Any links or resources would be appreciated.
Thanks!
Please advise how can this be achieved. Would VBScript be the easiest route?
Any links or resources would be appreciated.
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Import System.Web.Mail
Dim message As MailMessage
message = New MailMessage ()
message. To = "receiverID@domainName.Com"
message. From = "sender@domainName.com"
message. Subject = "Email Subject"
message.BodyFormat = MailFormat.Html
msgMail.Body = "<html><body><h2 " +
"align = center>Hello World! " +
"</h2></body></html>";
MailAttachment attachment1 =
new MailAttachment (@"c:\My Documents\OfficeFile1.doc");
// Add Another One...
MailAttachment attachment2 =
new MailAttachment ("d:\\Documents\\asp.netTurorial.doc");
message.Attachments.Add (attachment1);
message.Attachments.Add (attachment2);
SmtpMail.Send (message)
response. Write ("<BR><font color=red" +
" face=verdana size=2> " +
"Sent the mails. </font>")
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks All!
Although all answers were helpful, I meant to select CodeCruiser's answer as the Best answer. Not sure how to change that.
Although all answers were helpful, I meant to select CodeCruiser's answer as the Best answer. Not sure how to change that.
http://www.dreamincode.net/forums/topic/66603-how-to-send-email-using-vbnet-2008/