Jump to content

Adding link to PHPMailer email


NotionCommotion

Recommended Posts

I am sending emails using PHPMailer.  My configuration is below.

 

When adding a link to the message, should I use anchor tags?  Both seem to work.  What is the implication to recipients who are not using HTML email?

 

On a side note, if anything below seems wrong, please let me know.

 

Thanks

$msg='<p>Hello</p><p>Link: http://phpmailer.worxware.com/</p><p>Link: http://phpmailer.worxware.com</p><a href="http://phpmailer.worxware.com">http://phpmailer.worxware.com</a>';

$mail = new myPHPMailer(true);
$mail->AddReplyTo('[email protected]', 'Michael Reed');
$mail->SetFrom('[email protected]', 'Michael Reed');
$mail->AddAddress('[email protected]', 'John Doe');
$mail->Subject = "Here is your email";
//AltBody property need not be sent since PHPMailer will create an alternate automatically
$mail->MsgHTML($message);
return ($mail->Send());
class myPHPMailer extends PHPMailer {
    public function __construct($allow_exceptions=false){
        $this->isSMTP();
        $this->SMTPDebug = 0;
        $this->Host = "smtp.gmail.com";
        $this->Port = 587;
        $this->SMTPSecure='tls';  // sets the prefix to the server.  Used for gmail only.
        $this->SMTPAuth = true;
        $this->Username = 'xxx';
        $this->Password = 'xxx';
    }
}
Link to comment
https://forums.phpfreaks.com/topic/292912-adding-link-to-phpmailer-email/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.