Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple email problem

Status
Not open for further replies.

JazzLeg

Programmer
Aug 22, 2002
63
GB
Hi,
I'm trying to send multiple emails (using jmail) from one page, however only one the the messages appears to be sending.

Is there some sort of execute command i can add after each one so that each message is sent?
 
I actually need to do both....

A set of identical message to different recipients, and then another message with different body text to another recipient.
 
Shouldnt be a problem, i have achieved this just by using jmail more than once on a page.

To add multiple recipients you have to do something like:

dim oMsg
set oMsg = server.CreateObject("jmail.smtpmail")
oMsg.serveraddress = "smtp.ision.net.uk"
oMsg.subject = "Your order Confirmation"
oMsg.sender = "andrew.butt@dcseworld.com"

oMsg.addrecipient "ian@dcseurope.com"
oMsg.addrecipient "vikki@dcseurope.com"
oMsg.addrecipient "nick@dcseworld.com"
oMsg.addrecipient "nick@retrographics.fsnet.co.uk"

oMsg.Body = sbody
oMsg.execute
set oMsg = nothing

To send a completely different email just repeat the above code, should work fine (obviously substituting the server details etc. for your own).

Hope this helps!
Nick (Web Developer)


nick@retrographics.fsnet.co.uk
nick.price@myenable.com
 
Thanks very much, the add recipient works great!!

Still having trouble with sending a whole new message, it doesn't seem to like the '.execute' command. I f i repeat the code, it will only send the last email message on the page.
 
erm...

You could try creating a new jmail object with a different name for your second email. I can't understand why it wouldnt work, because it works fine for me.

Perhaps try putting the whole lot into a function, and call this twice instead of just repeating the code? Nick (Web Developer)


nick@retrographics.fsnet.co.uk
nick.price@myenable.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top