Hi All,
I've just built emailing into my SS app, and there seems to be something strange going on with the emails. It sends OK, but the email address I have placed in the from field also receives a copy. I've got the same application on 2 servers, 1 testing and 1 production, and it's doing the same from both. I also tried sending an email through a basic php script using the same addresses, and this behaviour doesn't occur in that case.
Have I missed something?
The application I'm building will be sending hundreds or even thousands of emails a day and we're not wanting them all sent back to us as well, any ideas?
here's the source code if it helps:
public function sendEmail($ID)
{
$sub = DataObject::get_by_id('RegistrationSubmission', $ID);
if ($sub)
{
$email = new Email_Template();
$email->to = $sub->Email;
$email->from = GFConst::email_from_name . '<' . GFConst::email_from . '>';
$email->subject = GFConst::submission_subject;
$email->ss_template = GFConst::submission_template;
$email->populateTemplate($sub);
$email->send();
}
}