Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Body of email 1

Status
Not open for further replies.

rac55

Programmer
Jul 1, 2003
62
AU
Hi

I am trying to put html tags in the body of an email for formatting purposes...but it is just writing the tags as text to the email...does anyone have any ideas what I am doing wrong?

Code is;

Dim objMM as New MailMessage()
objMM.To = iGridItem.Cells(iCol).Text
objMM.From = "u0008480@rgu.ac.uk"
objMM.BodyFormat = MailFormat.Text
objMM.Priority = MailPriority.Normal
objMM.Subject = "The Robert Gordon University Examination Results - Reminder"
objMM.Body = "<h2 class=header align=center>The School of Computing Examination Results " & _
"</h2><hr><br> Dear " & theFirstName & " " & theSurname & "<br><br> " & _
"Please note that return to university " & _
"forms need to be submitted by " & theDate & ". " & _
"Click here to <login> using Username:" & theStudId & " and Password:" & thePassword & ", " & _
"then click on Return to Uni Forms"

SmtpMail.SmtpServer = "mailhost.comp.rgu.ac.uk"
SmtpMail.Send(objMM)

Thanks
 
Hi rac55

I think you need to set your body format to HTML:

objMM.BodyFormat = MailFormat.Html

Hope this helps!

Craftor
:cool:
 
Hi Craftor

Thanks...that worked!!! :0)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top