phillystyle123
asked on
send message to 2 email accounts
I need to use this to send emails to 2 email addresses:
$this->sendMessage("me@mys ite.com", $mSubject, $message);
$this->sendMessage($to, "Thank you", $message_customer);
Something like this:
$this->sendMessage("me@mys ite.com, them@theirsite.com", $mSubject, $message);
$this->sendMessage($to, "Thank you", $message_customer);
$this->sendMessage("me@mys
$this->sendMessage($to, "Thank you", $message_customer);
Something like this:
$this->sendMessage("me@mys
$this->sendMessage($to, "Thank you", $message_customer);
basically in the to field concatenate email addresses using the ;
You can also inline the $to variable along with any other emails which will be expanded in your string:
NOTE: As shown above, you should use a semi-colon to separate email addresses in case you don't see that.
$this->sendMessage("me@mysite.com;them@theirsite.com", $mSubject, $message);
$this->sendMessage("$to;something@email.com", "Thank you", $message_customer);
NOTE: As shown above, you should use a semi-colon to separate email addresses in case you don't see that.
Uhh, it kind of looks like you want to send the messages to three accounts? me, them, and whatever address is in $to?
ASKER
still not getting this - I've tried
$this->sendMessage("me@mys ite.com;th em@theirsi te.com", $mSubject, $message);
neither email gets sent. i'm looking for a cc - the $to variable is sending a confirmation email
function notify_singup($to, $message, $message_customer)
{
$mSubject ="New Good Samaritan Hosiptal donation has been received";
$this->sendMessage("elkinh imer@sbcgl obal.net", $mSubject, $message);
$this->sendMessage($to, "Thank you for your donation to Good Samaritan Hospital", $message_customer);
}
$this->sendMessage("me@mys
neither email gets sent. i'm looking for a cc - the $to variable is sending a confirmation email
function notify_singup($to, $message, $message_customer)
{
$mSubject ="New Good Samaritan Hosiptal donation has been received";
$this->sendMessage("elkinh
$this->sendMessage($to, "Thank you for your donation to Good Samaritan Hospital", $message_customer);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This question should be deleted. The answer exists within the original question, and since the source for the function in question ("sendMessage()") is not provided, its functionality is questionable. The question is misleading and not helpful at all.
ASKER
I disagree -the answer does not exist in the original question - please advise
Here's the entire function:
function notify_singup($to, $message, $message_customer)
{
$mSubject ="New Good Samaritan Hosiptal donation has been received";
$this->sendMessage("email1 @mysite.co m", $mSubject, $message);
$this->sendMessage("email2 @mysite.co m", $mSubject, $message);
$this->sendMessage($to, "Thank you for your donation", $message_customer);
Here's the entire function:
function notify_singup($to, $message, $message_customer)
{
$mSubject ="New Good Samaritan Hosiptal donation has been received";
$this->sendMessage("email1
$this->sendMessage("email2
$this->sendMessage($to, "Thank you for your donation", $message_customer);
The function/method for which we have no reference or source is "$this->sendMessage()"; you gave the source for the method "notify_singup()".
From the original question:
The difference is that in your proposed solution, the first call to sendMessage() passed two email addresses separated by a comma. The second call simply changed a variable ("$to") to arbitrary text ("email1@mysite.com").
As pointed out by several experts, your original question seemed to indicate that you wanted to send an email to 3 different addresses: "me@mysite.com", "them@theirsite.com", and "$to". This fact was obscured due to the fact that two of the email addresses were used in one call.
It was pointed out that simply changing the separator between email addresses would fix the problem. Literally, your original code (the "something like this" part) would change from:
The difference is almost nothing and appears to have been completely overlooked.
From the original question:
$this->sendMessage("me@mysite.com, them@theirsite.com", $mSubject, $message);
$this->sendMessage($to, "Thank you", $message_customer);
Your solution:
$this->sendMessage("email1@mysite.com", $mSubject, $message);
$this->sendMessage("email2@mysite.com", $mSubject, $message);
The difference is that in your proposed solution, the first call to sendMessage() passed two email addresses separated by a comma. The second call simply changed a variable ("$to") to arbitrary text ("email1@mysite.com").
As pointed out by several experts, your original question seemed to indicate that you wanted to send an email to 3 different addresses: "me@mysite.com", "them@theirsite.com", and "$to". This fact was obscured due to the fact that two of the email addresses were used in one call.
It was pointed out that simply changing the separator between email addresses would fix the problem. Literally, your original code (the "something like this" part) would change from:
$this->sendMessage("me@mysite.com, them@theirsite.com", $mSubject, $message);
$this->sendMessage($to, "Thank you", $message_customer);
To:
$this->sendMessage("me@mysite.com; them@theirsite.com", $mSubject, $message);
$this->sendMessage($to, "Thank you", $message_customer);
The difference is almost nothing and appears to have been completely overlooked.
ASKER
See my earlier post - i tried the suggested solutions, they didn't work, mine did. I do want to send to 3 email addresses -
This didn't work:
$this->sendMessage("me@mys ite.com; them@theirsite.com", $mSubject, $message);
$this->sendMessage($to, "Thank you", $message_customer);
This did:
$this->sendMessage("me@mys ite.com", $mSubject, $message);
$this->sendMessage("someon eelse@mysi te.com", $mSubject, $message);
$this->sendMessage($to, "Thank you", $message_customer);
This didn't work:
$this->sendMessage("me@mys
$this->sendMessage($to, "Thank you", $message_customer);
This did:
$this->sendMessage("me@mys
$this->sendMessage("someon
$this->sendMessage($to, "Thank you", $message_customer);
still not getting this - I've tried
$this->sendMessage("me@mysite.com;them@theirsite.com", $mSubject, $message);
neither email gets sent. i'm looking for a cc - the $to variable is sending a confirmation email
function notify_singup($to, $message, $message_customer)
{
$mSubject ="New Good Samaritan Hosiptal donation has been received";
$this->sendMessage("elkinhimer@sbcglobal.net", $mSubject, $message);
$this->sendMessage($to, "Thank you for your donation to Good Samaritan Hospital", $message_customer);
}
It seems that the problem exists with the "sendMessage()" method, which was probably throwing errors or otherwise failing because of some sort of testing. I would venture a guess that the problem is in fact with how it parses the email address, as it is probably only expecting one, when it should be able to explode the first var by ";" (if present) and test all the addresses in that array.
The answer given is more of a work-around: instead of fixing "sendMessage()" to accept multiple email addresses (something that any MTA should be able to handle), the solution was to call the method again.
I'm not trying to be a pain, merely pointing out a problem I saw. If you still wish to close the question by accepting your own answer, I will not object further.
The answer given is more of a work-around: instead of fixing "sendMessage()" to accept multiple email addresses (something that any MTA should be able to handle), the solution was to call the method again.
I'm not trying to be a pain, merely pointing out a problem I saw. If you still wish to close the question by accepting your own answer, I will not object further.
ASKER
I see your point crazedsanity. I still think if someone's banging there head against the wall trying to figure this out (it's built into Authorize.net's ARB API ) this at least will offer a work around.
ASKER
None of the other solutions worked - this one did.
$to = "email@domain.com; email2@domain2.com";