From Name for Sender
Posted: Wed Aug 13, 2008 2:53 pm
Hello,
I would like my name to be used for the sender, NOT my email address.
So when a person receives an email they should see my name in the "from" field.
I would like my name to be used for the sender, NOT my email address.
So when a person receives an email they should see my name in the "from" field.
Code: Select all
<?php
require_once "mailLib/Swift.php";
require_once "mailLib/Swift/Connection/SMTP.php";
$smtp =& new Swift_Connection_SMTP("smtp.example.com", 25);
$smtp->setUsername("support@example.com");
$smtp->setpassword("password");
$swift =& new Swift($smtp,"[example.com]");
//Create the message
$message =& new Swift_Message("This is the Subject", "Hello.\n\nRegards,\nMe");
//Now check if Swift actually sends it
if ($swift->send($message, "you@example.com", "me@example.com>")) echo "Sent!!"; else echo "Failed";
?>