469,072 Members | 1,840 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,072 developers. It's quick & easy.

Formatting CDO message body

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 = "X@X.COM"
email.To = "X@X.COM"
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)
Nov 19 '05 #1
1 5771
Hi Andre
Since the format is email.BodyFormat = MailFormat.Html
You should use "<BR>" or "<P>" "</P>" instead
HTH Marcos
"Andre" <an**********@hotmail.com> escreveu na mensagem
news:87**************************@posting.google.c om...
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 = "X@X.COM"
email.To = "X@X.COM"
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)

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Dan Weeb | last post: by
3 posts views Thread by Petre Huile | last post: by
7 posts views Thread by BBFrost | last post: by
4 posts views Thread by Ken Wigle | last post: by
1 post views Thread by SAL | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.