Add Email Sender Name

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

Add Email Sender Name

Post by mehmetbkm »

When phpmaker sends an automatic e-mail, I want to print the company name instead of my e-mail address in the recipient's inbox.

Subject: <?= $Subject ?>
From: <?= $From ?>
To: <?= $To ?>
Cc:
Bcc:
Format: HTML

<p>Record status changed as follows:</p>

<p>
Table: <?= $Table ?><br>
Key value: <?= $Key ?><br>
Action: <?= $Action ?>
</p>


mobhar
User
Posts: 11727

Post by mobhar »

You may use Email_Sending server event to change the Recipient's email.


mehmetbkm
User
Posts: 8

Post by mehmetbkm »

I'm trying the code below based on your suggestion, but I didn't get any results.

function Email_Sending($email, $args) {
    // var_dump($email, $args);
    // exit();
    if (CurrentPageID() == "add") { // If Add page
        $email->setFrom = $args["rsnew"]["my_mail@adres.com', 'My_Company_Name"];
    }
    return true;
}

mobhar
User
Posts: 11727

Post by mobhar »

You may try:

function Email_Sending($email, $args) {
    // var_dump($email, $args);
    // exit();
    if (CurrentPageID() == "add") { // If Add page
        $email->Sender = "My_Company_Name <my_mail@adres.com>";
    }
    return true;
}

Post Reply