The following code creates a file called "TESTFILE.TXT" and emails to a recipient. Don't forget to change .TO and .FROM
Public Sub TEST()
Open "C:\TESTFILE.TXT" For Output As #1 ' Open file for output.
Print #1, "Line 1" ' Print text to file.
Print #1, "Line 2"
Dim iMsg As Object
Dim iConf As Object
Set iMsg = CreateObject("CDO.Message"
Set iConf = CreateObject("CDO.Configur
") = 2 ' Use this mode in conjunction with the next line.
") = GetServerNameSMTP()
Set .Configuration = iConf
.To = "YourEmail@hotmail.com" ' DON"T FORGET TO CHANGE HERE
.cc = ""
.bcc = ""
.FROM = "YouEmail@hotmail.com" ' DON"T FORGET TO CHANGE HERE
.Subject = "Subject"
.TextBody = "Body"
If I send the file using mouse and keyboard it works fine on the receipt of attachment. When I use the code above to send, the attachment goes through with screwed up CRLF's i see a square when open the received attachment in notepad.
Expected contents on received file
Observed contents on received file (the  is one square character probably a ascii 10 or a ascii13 only instead of both)
QUESTION: How do i get CDO to NOT screw up the CRLF's?