Jump to content

Sending an email to multiple people


Recommended Posts

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

Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

  • 2 years later...

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...