hello
version 3.15
about the sendEmail() function.
now the function is using in my logic.
when I send the email to 100 user. I am calling sendEmail() 100 times.
my question is that can I use sendEmail() function one time for 100 person (multiple person) ?
About sendEmail function.
- dbindernagel
- Posts:161
- Joined: Mon Feb 23, 2015 1:34 pm
Re: About sendEmail function.
I'm not sure if this is possible but have you tried separating multiple recipients with a comma "," (or maybe a semicolon ";")?
Like this:
PS: According to the help file the index 1 of email parameter should be the destination and index 2 should be the source, but in the example they provide it is exactly the other way round. Since I have never used the function myself I'm not sure what is correct.
Like this:
Code: Select all
main()
{
string smtp_host = "smtp.gmail.com:587";
dyn_string email;
email = makeDynString(
"recipient1@gmail.com,recipient2@gmail.com",
"sender@gmail.com",
"Test",
"This is a test.");
int ret;
string smtp_user = "myUsername";
string smtp_pass = "myPassword";
bool useTLS = true;
sendMail(smtp_host, email, ret, smtp_user, smtp_pass, useTLS);
}