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. Quote Link to comment 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. Quote Link to comment 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: youremail@domain.com'); Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.