ok Posted September 2, 2008 Share Posted September 2, 2008 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 https://forums.phpfreaks.com/topic/122381-how-to-insert-link-inside-a-html-message-using-mail/ Share on other sites More sharing options...
BlueSkyIS Posted September 2, 2008 Share Posted September 2, 2008 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 https://forums.phpfreaks.com/topic/122381-how-to-insert-link-inside-a-html-message-using-mail/#findComment-631910 Share on other sites More sharing options...
mattennant Posted September 2, 2008 Share Posted September 2, 2008 does this help //send an email here? $body = "Hi\n email body here\n .\n website: http://www.site.com.com Username: {$_POST['username']}\n Password: {$_POST['password']}\n "; mail($_POST['email'], 'subject line here' , $body, 'From: [email protected]'); Link to comment https://forums.phpfreaks.com/topic/122381-how-to-insert-link-inside-a-html-message-using-mail/#findComment-631917 Share on other sites More sharing options...
BlueSkyIS Posted September 2, 2008 Share Posted September 2, 2008 ^ 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 https://forums.phpfreaks.com/topic/122381-how-to-insert-link-inside-a-html-message-using-mail/#findComment-631921 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.