Jump to content
Sign in to follow this  
MobilAdmin

Sending an email to multiple people

Recommended Posts

MobilAdmin

I use a simple script to send email alerts on specific events. My question is how do I get the script to send the alert to multiple people at once. This is my code so far...

#include <INet.au3>

$s_SmtpServer = "XXX.XXXXXXX.XXX"

$s_FromName = "XXXX"

$s_FromAddress = "XXX@XXXXXX.XXX"

$s_ToAddress = "XXXXXXXX@XXXX.XXXXXXXXX.XXXXX"

$s_Subject = "Test"

Dim $as_Body[1]

$as_Body[0] = "Testing"

$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @computername, -1)

Any suggestions would be helpful.

Thanks

Share this post


Link to post
Share on other sites
colafrysen

Dim $s_ToAddress[3] = ["Adress1@Provider.com","Adress2@Provider.com","Adress3@Provider.com"]

For $X=0 to ubound($s_ToAddress)-1 step 1

$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress[$X], $s_Subject, $as_Body, @computername, -1)

next


[font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size]

Share this post


Link to post
Share on other sites
nfaustin

I just concatenate and put semicolon in-between email address and it still works:

$s_ToAddress = "name1@gmail.com; name2@gmail.com; name3@gmail.com"

[font="Palatino Linotype"][size="2"]*** The information contained in this post should be considered and certified WORKS ON MY MACHINE ***[/size][/font][font="Palatino Linotype"][size="2"] [/size][/font]

Share this post


Link to post
Share on other sites
Jackized

I just concatenate and put semicolon in-between email address and it still works:

$s_ToAddress = "name1@gmail.com; name2@gmail.com; name3@gmail.com"

I tried this and it only emails the last person in the list but looks like it emailed everyone.

Share this post


Link to post
Share on other sites
Jackized

Dim $s_ToAddress[3] = ["Adress1@Provider.com","Adress2@Provider.com","Adress3@Provider.com"]

For $X=0 to ubound($s_ToAddress)-1 step 1

$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress[$X], $s_Subject, $as_Body, @computername, -1)

next

This works great and each recipient does not see the others.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.