Sending Mail To Outlook

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?
 
K

Ken Slovak - [MVP - Outlook]

<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))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top