Sending an email

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
greenfish
User
Posts: 107

Sending an email

Post by greenfish »

Hello,
I am trying to setup my first send email on add.
So I have put in the names of my fields. I have the email setup complete. I have clicked the checkbox for Email Notification "Add".
I have added the code below to the table-Specific -> Common -> Email_Sending event.

function Email_Sending(&$Email, &$Args) {
//var_dump($Email);
//var_dump($Args);
//exit();
if (CurrentPageID() == "add") { // If Add page
$Email->Recipient = $Args["rsnew"]["user_email"]; // Change recipient to a field value in the new record
$Email->Subject = "Your Helpdesk Ticket has been Submitted"; // Change subject
$Email->Content .= "\nAdded by " . CurrentUserName(); // Append additional content
}
return TRUE;
}

I am receiving the following error:
The following From address failed: : Called MAIL FROM without being connected

My goal is to send an email from the current user logged in (CurrentUserName()) to the person who filled out the form (user_email).

Any ideas? Many thanks in advance.


mobhar
User
Posts: 11745

Post by mobhar »

Make sure you have already defined the Email settings under "PHP" -> "Email Settings".

Please read "Email Settings" under "PHP Settings" topic from PHPMaker Help menu for more information.


Post Reply