MobilAdmin Posted August 14, 2009 Posted August 14, 2009 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
colafrysen Posted August 14, 2009 Posted August 14, 2009 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]
nfaustin Posted August 14, 2009 Posted August 14, 2009 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]
Jackized Posted September 9, 2011 Posted September 9, 2011 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.
Jackized Posted September 9, 2011 Posted September 9, 2011 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now