This topic is locked

Events function BeforeAdd(&$values) Simple Email

12/7/2006 4:47:25 PM
PHPRunner General questions
H
HurricanHollow author

Hi All,
I have been struggling with this 1/2 the day and finally found a solution, so I thought I would share.
When I setup an event BeforeAdd(&$values) simple email to the user who just added a new record I was not getting the email or any error message, so I put in a CC address and found that the sent email To: field contained single quotes ('user@mysite.com'), after searching the other post I found something Jane had wrote about stripping out the single quotes and tried it successfully -here it is.
$email=substr($values["Email"],1,strlen($values["Email"])-2);

$subject="Confirmation Email";

$message="Please do not reply to this email -it is an automated message.

--snip---

Thank you.\n\n\nBest Regards \nOur Team";

mail($email, $subject, $message,"From: Events@mysite.com");
I guess my server setup is a little different than others and I also had to take out the CC address for this to work!
Hope this helps somebody...
Cheers