Jump to content

how to insert link inside a html message using mail()


ok

Recommended Posts

hi guys

 

i have these message content of an email using mail() below,

 

$message = "
<html>
<head>
</head>
<body>
<h3>Dear $ffname,</h3><br>
Your friend $ufname $ulname is inviting you to join a $50 dollar gas card.<br>
?>
<a href=\"<?php echo $tmp_dir; ?>ureferer=$ufull_name \"><h4><h4>Please Click here to join!</h4></a>
<?php
Join now and be a candidate to win the $50 dollar gas card every week.<br>
For more details please visit the link.<br><br>
<h4>Thank you!</h4>
</body>
</html>";

 

actually i'm trying to insert a link inside the message of an email  which is html format and that will carry a variable value.

 

but it's not working.

 

can you show me the right way please

 

thanks.

 

Link to comment
Share on other sites

using the mail() function, you would need to define the message as html/text, then insert the proper delimiters to identify the portion of the mail message that is HTML. I skip all that and use the very excellent htmlmimemail.php from here:

 

http://www.phpguru.org/static/mime.mail.html

 

there are examples on the site and included with the download. essentially create the object, set the HTML value to the HTML you want to send, then send it to your list of recipients.

Link to comment
Share on other sites

^ that still won't work, as you haven't set the proper email headers to tell the email reading application that the included content is HTML.

 

as i stated before: if you don't want to mess with setting the proper headings and delimiting MIME boundaries, you're better off using the existing htmlmimemail code.

Link to comment
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.