Sending Mail To Outlook

  • Thread starter Thread starter Mariame
  • Start date Start date
M

Mariame

Hi Everyone
im using the following code to send an email:
Dim smtpmail As Mail.SmtpMail

Dim msgRequest As New Mail.MailMessage

msgRequest.BodyFormat = Mail.MailFormat.Text

msgRequest.Subject = "Subject"

msgRequest.To = "to.com"

msgRequest.From = "from.com"

dim a, b as string

x = a+"<br>"+b

msgRequest.Body = x

smtpmail.SmtpServer = "server"

smtpmail.Send(msgRequest)

the body of the message contain multiple line & i want to make break with
<br> but it doesent work

Any idea about how to make break line in body?
 
<br> is only useful in HTML, so you'd need to use MailItem.HTMLBody, not
..Body. For Body you would use vbCRLF (Chr(10) & Chr(13))
 
Back
Top