Formatting CDO message body

A

Andre

Hi folks,

I'm trying to create a sub that e-mails the results of program output
to our accounts receivable manager. I built my CDO code using examples
from a couple newsgroups like this one, so I didn't see any examples
of how the message body is coded.

I wrote the CDO mailer as shown below, the output is all there but the
carriage returns don't carry into the e-mail message, the message body
appears as one line. Is the sample below the most efficient way for
doing this, and how do I get the mail message to format carriage
returns, etc? Any advice or code snippets would be much appreciated.

Thanks,

Andre



email.BodyFormat = MailFormat.Html
email.Priority = MailPriority.High
email.From = "(e-mail address removed)"
email.To = "(e-mail address removed)"
email.Subject = "Nextel Correction Utility (do not reply)"
email.Body = "Account Number: " & lblAccountKey.Text &
Chr(10) & _
"Service ID: " & lngServiceID & Chr(10) & _
"Completed Employee: " & strCompletedEmployee & Chr(10) & _
"Service: " & strService & Chr(10) & _
"Measurement: " & intMeasurement & Chr(10) & _
"Mix Code: " & strItemID & Chr(10) & _
"Actual Quantity: " & intItemActualUnits & Chr(10) & _
"Temperature: " & intTemperature & Chr(10) & _
"Wind Direction: " & strWindDirection & Chr(10) & _
"Wind Speed: " & intWindSpeed & Chr(10) & _
"Amount Completed: $" & Format(curAmountCompleted,
"#,##0.00") & vbCrLf & _
"Tax Completed: $" & Format(curTaxCompleted, "#,##0.00") &
vbCrLf & _
"Sales Amount: $" & Format(curSaleAmount, "#,##0.00") &
vbCrLf & _
"Tax Amount: $" & Format(curTaxAmount, "#,##0.00") &
vbCrLf & _
"Total Invoice: $" & Format(curTotalInvoice, "#,##0.00") &
vbCrLf & _
"Renewal Amount: $" & Format(curRenewalAmount, "#,##0.00")
& vbCrLf & _
"Sales Comm Value: $" & Format(curSalesCommValue, "#,##0.00")
& vbCrLf & _
"Prod Comm Value: $" & Format(curProdCommValue, "#,##0.00")
& vbCrLf


'// Send the e-mail
SmtpMail.SmtpServer = "X.X.X.X"
SmtpMail.Send(email)
 
M

Marcos Ribeiro

Hi Andre
Since the format is email.BodyFormat = MailFormat.Html
You should use "<BR>" or "<P>" "</P>" instead
HTH Marcos
 

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


Top