473,586 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.BodyForma t = MailFormat.Html
email.Priority = MailPriority.Hi gh
email.From = "X@X.COM"
email.To = "X@X.COM"
email.Subject = "Nextel Correction Utility (do not reply)"
email.Body = "Account Number: " & lblAccountKey.T ext &
Chr(10) & _
"Service ID: " & lngServiceID & Chr(10) & _
"Completed Employee: " & strCompletedEmp loyee & Chr(10) & _
"Service: " & strService & Chr(10) & _
"Measuremen t: " & intMeasurement & Chr(10) & _
"Mix Code: " & strItemID & Chr(10) & _
"Actual Quantity: " & intItemActualUn its & Chr(10) & _
"Temperatur e: " & intTemperature & Chr(10) & _
"Wind Direction: " & strWindDirectio n & Chr(10) & _
"Wind Speed: " & intWindSpeed & Chr(10) & _
"Amount Completed: $" & Format(curAmoun tCompleted,
"#,##0.00") & vbCrLf & _
"Tax Completed: $" & Format(curTaxCo mpleted, "#,##0.00") &
vbCrLf & _
"Sales Amount: $" & Format(curSaleA mount, "#,##0.00") &
vbCrLf & _
"Tax Amount: $" & Format(curTaxAm ount, "#,##0.00") &
vbCrLf & _
"Total Invoice: $" & Format(curTotal Invoice, "#,##0.00") &
vbCrLf & _
"Renewal Amount: $" & Format(curRenew alAmount, "#,##0.00")
& vbCrLf & _
"Sales Comm Value: $" & Format(curSales CommValue, "#,##0.00")
& vbCrLf & _
"Prod Comm Value: $" & Format(curProdC ommValue, "#,##0.00")
& vbCrLf
'// Send the e-mail
SmtpMail.SmtpSe rver = "X.X.X.X"
SmtpMail.Send(e mail)
Nov 19 '05 #1
1 6072
Hi Andre
Since the format is email.BodyForma t = MailFormat.Html
You should use "<BR>" or "<P>" "</P>" instead
HTH Marcos
"Andre" <an**********@h otmail.com> escreveu na mensagem
news:87******** *************** ***@posting.goo gle.com...
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.BodyForma t = MailFormat.Html
email.Priority = MailPriority.Hi gh
email.From = "X@X.COM"
email.To = "X@X.COM"
email.Subject = "Nextel Correction Utility (do not reply)"
email.Body = "Account Number: " & lblAccountKey.T ext &
Chr(10) & _
"Service ID: " & lngServiceID & Chr(10) & _
"Completed Employee: " & strCompletedEmp loyee & Chr(10) & _
"Service: " & strService & Chr(10) & _
"Measuremen t: " & intMeasurement & Chr(10) & _
"Mix Code: " & strItemID & Chr(10) & _
"Actual Quantity: " & intItemActualUn its & Chr(10) & _
"Temperatur e: " & intTemperature & Chr(10) & _
"Wind Direction: " & strWindDirectio n & Chr(10) & _
"Wind Speed: " & intWindSpeed & Chr(10) & _
"Amount Completed: $" & Format(curAmoun tCompleted,
"#,##0.00") & vbCrLf & _
"Tax Completed: $" & Format(curTaxCo mpleted, "#,##0.00") &
vbCrLf & _
"Sales Amount: $" & Format(curSaleA mount, "#,##0.00") &
vbCrLf & _
"Tax Amount: $" & Format(curTaxAm ount, "#,##0.00") &
vbCrLf & _
"Total Invoice: $" & Format(curTotal Invoice, "#,##0.00") &
vbCrLf & _
"Renewal Amount: $" & Format(curRenew alAmount, "#,##0.00")
& vbCrLf & _
"Sales Comm Value: $" & Format(curSales CommValue, "#,##0.00")
& vbCrLf & _
"Prod Comm Value: $" & Format(curProdC ommValue, "#,##0.00")
& vbCrLf
'// Send the e-mail
SmtpMail.SmtpSe rver = "X.X.X.X"
SmtpMail.Send(e mail)

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2391
by: Dan Weeb | last post by:
Hi All, I have struggled through this far with help from many of you so thanks. I am stuck again. I am really new to this so don't be harsh :-) There are a few problems. You can run the script here http://www.pbrown.com/research/test1.php to see the formatting issues Formatting Issues
4
1840
by: Rob Meade | last post by:
Hi all, Ok - this leads on from speaking to a couple here and in the SQL server group... I've an application which allows the user to type in their text into a form, they add 'happy' tags around their words, the app then replaces these with the html equivalent and saves it to the database... Thus far this has been working very well.
8
4359
by: Jonathan | last post by:
Hi, I have to use the nl2br function in the asp file, luckly I got this code from a site. What I need done is to display textbox content the way it was typed/pasted i.e. with paragraph breaks and color formatting. The code I used is below but it does not work. Can someone please help me out, its rather urgent and important. <% function...
3
2631
by: Petre Huile | last post by:
I'm trying to mail form data by using the technique: form.action="mailto:address?Subject=subject&body=bodyText" (the placeholders above are obviously not real :)). The thing is I want to customize the body text, but the submit action of the form always overwrites any body text I set in the line above with the default output of the form...
5
3468
by: Tom Petersen | last post by:
I have this: 1 emailBody = "<html>" & vbCrLf _ 2 & "<head>" & vbCrLf _ 3 & "<title>Interpreter Request details</title> " & vbCrLf _ 4 & "</head> " & vbCrLf _ 5 & "<body> " & vbCrLf _ 6 & "<font face=Verdana><b>Interpreter...
7
3924
by: BBFrost | last post by:
I'm receiving decimal values from database queries and placing them on a report page. The users want to see the following .... Db Value Display Value 123.3400 123.34 123.0000 123 i.e. I want to trim trailing zeros and (decimal point if no decimal values
9
3200
by: sck10 | last post by:
Hello, I have a page with an ImageButton that is used to redirect to another page. When the page first opens, everything looks as expected. However, when I click on the image, the new page opens as expected. However, when I go back to the original page, all the font sizes are larger. Its as if by clicking on the ImageButton, my CSS...
4
8319
by: Ken Wigle | last post by:
All, I would be very grateful for any help on this question. I have an application in asp.net 2.0 where I dynamically create a datatable and then bind that to a gridview. Unfortunately, the date column always shows the date and time while I just want the short date. I have tried applying a format string {0:d} but to no avail. I saw a...
1
1262
by: SAL | last post by:
Hello, I am sending an e-mail message from my ASP.NET 2.0 application. The body of the message is coming from a database and formatting has already been applied to the text. My problem is that if I set: IsBodyHtml = True The body looses its formatting. I'm including an hyperlink in the body, which I'd like to be clickable, but I don't care...
0
7912
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8216
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.