472,111 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,111 software developers and data experts.

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 5933
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.