WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: seckner on August 29, 2014, 02:10:47 PM

Title: SMTPSendText
Post by: seckner on August 29, 2014, 02:10:47 PM
When using the SMTPSendText function I'm seeing a small message body problem. I'm sending a simple report - 1 line per. Each line begins with a CRLF. What I'm getting in the body is:

Aug 31 2014, at 09:14 for Name Here
Sep 08 2014, at 16:00 for Name Here
Sep 04 2014, at 11:41 for Name Here Sep 04 2014, at 09:02 for Name Here Sep 08 2014, at 13:10 for Name Here Sep 08 2014, at 14:33 for Name Here

Seems to miss the CRLF after the 3rd entry. If I do a "CRLF : CRLF : data" it reliably sets the entire thing to 2x line spacing. Any ideas?

Title: Re: SMTPSendText
Post by: td on August 29, 2014, 02:45:50 PM
Tried the SmtpSenText example with a modified message:

Code (winbatch) Select

damsg = "Have you noticed... it's raining." :@crlf:"Which is nothing New."
rc = SmtpSendText ( mserver, whofrom, whoto, dasubj, damsg )


The resulting email was formated with two lines when received by the Email client.
Title: Re: SMTPSendText
Post by: stanl on August 30, 2014, 03:18:49 AM
Quote from: seckner on August 29, 2014, 02:10:47 PM
Each line begins with a CRLF.

What if you try each line ending with CRLF.
Title: Re: SMTPSendText
Post by: JTaylor on August 30, 2014, 07:03:31 AM
I tried it with 15-20 lines like you posted and viewed the message in a web mail client and outlook and they both were as you want.  Perhaps you could post the part of the script that generates the report and sends it?  Someone might see something.

or maybe try the following.  If it works then the problem may be that the formatting of your text isn't quite what you think.   Either way we'll at least be looking at the same code.


Code (winbatch) Select

AddExtender( "wwwsk44I.dll" )
damsg = ""
damsg = damsg:@CRLF:"Aug 31 2014, at 09:14 for Name Here"
damsg = damsg:@CRLF:"Sep 08 2014, at 16:00 for Name Here"
damsg = damsg:@CRLF:"Sep 04 2014, at 11:41 for Name Here"
damsg = damsg:@CRLF:"Sep 04 2014, at 09:02 for Name Here"
damsg = damsg:@CRLF:"Sep 08 2014, at 13:10 for Name Here"
damsg = damsg:@CRLF:"Sep 08 2014, at 14:33 for Name Here"
damsg = damsg:@CRLF:"Sep 08 2014, at 14:33 for Name Here"
damsg = damsg:@CRLF:"Sep 08 2014, at 14:33 for Name Here"
damsg = damsg:@CRLF:"Sep 08 2014, at 14:33 for Name Here"
damsg = damsg:@CRLF:"Sep 08 2014, at 14:33 for Name Here"
damsg = damsg:@CRLF:"Sep 08 2014, at 14:33 for Name Here"
damsg = damsg:@CRLF:"Sep 08 2014, at 14:33 for Name Here"
damsg = damsg:@CRLF:"Sep 08 2014, at 14:33 for Name Here"


mserver = "mail.xxxxxx.xxx"
whofrom = "xxxxxxx@xxxxxx.xxx"
whoto = "xxxxxxx@xxxxxx.xxx"
dasubj = "Greetings"

rc = smtpSendText ( mserver, whofrom, whoto, dasubj, damsg )
Message( "Mail sent Return code is",rc )



Jim
Title: Re: SMTPSendText
Post by: td on August 30, 2014, 07:52:41 AM
Quote from: stanl on August 30, 2014, 03:18:49 AM
Quote from: seckner on August 29, 2014, 02:10:47 PM
Each line begins with a CRLF.

What if you try each line ending with CRLF.

Beginning each line with a CRLF doesn't affect anything.  Actually, you don't even need to use a CRLF.  A CR is sufficient to demarcate each line as the extender function looks for CRs and discards trailing LFs.
Title: Re: SMTPSendText
Post by: seckner on September 04, 2014, 09:21:44 AM
First, sorry for the long delay - beginning our season and things get a bit nuts...

And, I don't feel very smart today -it was 100% my problem: Outlook - Remove extra line breaks. Duh!  :-[

Thanks to everyone for their help! This is STILL the best support forum anywhere!
Title: Re: SMTPSendText
Post by: DAG_P6 on September 05, 2014, 10:01:31 AM
AMEN to that! :)