Jump to content

sending a html link in a an email mail()


otuatail

Recommended Posts

$msg = "Test msg ";
$RemoveMsg = "Extra info ";
$RemoveMsgTag = "< a href='http://site2.desmond-otoole.co.uk/CustomerRemove.php'>Remove me</a>";
$msg .= "\r\n\r\n$RemoveMsg $RemoveMsgTag\r\n";

$success = mail($emailList,$subject, $msg, $headers, '[email protected]'); // must comply with » RFC 2822.

Hi I want to send out a mailing list with a link at the bottom for anyone wishing to be removed. I can't get the link working.

 

Link to comment
https://forums.phpfreaks.com/topic/297200-sending-a-html-link-in-a-an-email-mail/
Share on other sites

$name="postmaster";
$site ="millersyard";
$webemail = $site . "@desmond-otoole.co.uk";
$headers = "From: $name <$webemail>\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$RemoveMsgTag = "< a href='http://site2.desmond-otoole.co.uk/CustomerRemove.php'>Remove me</a>";
$msg .= "\r\n\r\n$RemoveMsg $RemoveMsgTag\r\n";

$success = mail($emailList,$subject, $msg, $headers, '[email protected]'); // must comply with » RFC 2822.

I have tried turning it into a html email using code found on internet.

 

 

Using plain text email, I just put the raw link (no anchor tag) on it's own line starting with http://. MOST email clients will automatically change anything that starts with http:// into a clickable link.

 

Try just using:

http://site2.desmond-otoole.co.uk/CustomerRemove.php

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.