JMAIL: Multiple Recipient

899 Views Asked by At

Does JMail accepts delimiter(;) or comma(,) as a separator between different email address like CDO.Message.

For example, we can write,

Mail.To="[email protected],[email protected]" in CDO.Message.

Does the same is valid for JMAIL like the one below.

jMail.AddRecipient ("[email protected],[email protected]")

I know we can add multiple recipients by calling the AddRecipient again and again but my question is can we do it in a single line like in CDO.Message?

2

There are 2 best solutions below

2
Imamul Karim Tonmoy On

yes you can add multiple recipients by calling the AddRecipient

0
Milan On

Yes, you can.

I spent some time figuring this out as well. I tried the recommended array() of recipients but that did not seem to work. The only thing which worked for me so far was a properly formatted multiple recipient string:

$jmail->addRecipient('[email protected]','[email protected]','[email protected]');

Please note the ["] markup. If you replace the ["] with ['] it will not work. It's little "delicate" this way :)

I am using jMail with PHP/COM extension but I am sure you can reuse this principle for ASP or any other language.

I hope this helped.