Jump to content

Recommended Posts

Posted

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

Posted

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]
Posted

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]
  • 2 years later...
Posted

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.

Posted

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.

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
×
×
  • Create New...