SMTPSendMail.... Recipients...

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
CyberNeo

SMTPSendMail.... Recipients...

Post by CyberNeo » Tue Apr 27, 2004 10:46 pm

How can I put a list of emails from a .txt file into the recipients field ??

I try the follow command

Let>k=1
Label>start
ReadLn>c:\temp\File.txt,k,line
If>line=##EOF##,finish
Let>recipients=%recipients%%CRLF%%line%
Let>k=k+1
Goto>start
Label>finish

It's like the same as in the ReadLn

Let>k=1
Label>start
ReadLn>c:\temp\test.txt,k,line
If>line=##EOF##,finish
Message>line
Let>k=k+1
Goto>start
Label>finish

But I change body for recipients. The Macro run, run and run, she Crash so...


Thanx in advance

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Apr 27, 2004 11:03 pm

This is how I keep my syntax for emails. It shows me that I can have multiple recipients/attachments by separating with each with a semicolon.

SMTPSendMail>To_email(;s),smtp,From_email,From_name,Subject,Body,Attachment(;s)

So try changing
FROM:
Let>recipients=%recipients%%CRLF%%line%
TO:
Let>recipients=%recipients%;%line%
SMTPSendEmail>%recipients%,smtp,From_email,From_name,%Subject%,%Body%,%Attachment%
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Guest

Post by Guest » Tue Apr 27, 2004 11:16 pm

Thanx for your answer but it didnt works. Thanx for your effort.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Apr 28, 2004 5:23 am

How about including samples of the text file you are reading.

And also include the syntax and code you are using for the email.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Apr 28, 2004 7:43 am

As Bob says the recipients list must be delimited by semicolons. This works. So if yours isn't it must be something to do with the way you are building the list - not with the SMTPSendMail command.

Step through your code with the debugger and watch list. If still stuck send a copy of your code so that we can try to help.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts