Jump to content

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('myEmail@xxx.com', 'Michael Reed');
$mail->SetFrom('myEmail@xxx.com', 'Michael Reed');
$mail->AddAddress('johndoe@xxx.com', '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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.