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

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

Similar Threads

Sending Email 1
Sending Mails 2
Sending E-mail 1
MailMessage Headers 5
sending an email... 2
Sending Mail 1
Send Mail : I don't receive my message 7
Send email using vba code 3

Back
Top