java - Play Framework MVC mailer -
i have application sends email through play mvc mailer plugin, while register , forgot password. need know how send bulk email using same plugin. need send email user when new user registered.
here code using send email:
setsubject("confirm registration"); addrecipient(ua.username); setfrom("support@xxxx.com"); send(ua, user);
here need know how add multiple recipient , send email?
that's easy. can call addrecipient
multiple times add more recipients. or can pass multiple recipients it, this:
addrecipient("alice@example.com", "bob@example.com", "charlie@example.com");
or can pass array addrecipient
:
string[] rcpts = new string[] {"alice@example.com", "bob@example.com"}; addrecipient(rcpts);
or can take list
, make array it, , pass it:
list<string> rcptslist = new arraylist<string>(); rcptslist.add("alice@example.com"); rcptslist.add("bob@example.com"); addrecipient(rcptslist.toarray(new string[rcptslist.size()]));
Comments
Post a Comment