About sendEmail function.

Discussion about recent product features & solutions!
2 posts • Page 1 of 1
dongil
Posts:49
Joined: Mon Oct 07, 2013 3:42 am

About sendEmail function.

Post by dongil »

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) ?

dbindernagel
Posts:161
Joined: Mon Feb 23, 2015 1:34 pm

Re: About sendEmail function.

Post by dbindernagel »

I'm not sure if this is possible but have you tried separating multiple recipients with a comma "," (or maybe a semicolon ";")?

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);
}
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.

2 posts • Page 1 of 1