Thursday, March 29, 2012

Mails with asp.net

Is it possible with asp.net to make automatically sent emails? I think it is called SMTP-mail or somthing like that. My server is MicrosoftSending mail couldn't be simpler in asp.net
Imports System.Web.Mail
and then create a mail object and assign it's subject, text etc and send
Dim ObjMM As New MailMessage
ObjMM.From = "xxx@.xxx.co.uk"
ObjMM.To = "xxx@.xxx.co.uk"
ObjMM.Subject = "Auto Email"
ObjMM.Body = strMessage
ObjMM.BodyFormat = MailFormat.html
SmtpMail.Send(ObjMM)

If you need to specify a different smtp server...SmtpMail.SmtpServer = "smtp.xxx.co.uk"

0 comments:

Post a Comment