mail($adminemail, $subj, $msg, "FROM: $name\r\nReply-to: $from\r\nContent-type: text/html; charset=iso-8859-1\r\n"); Code (markup): Do you see any errors in the code above? $name,$from are grabbed via $_POST. It doesn't seem to work correctly. I do recieve it in HTML format, but the FROM is altered.
I have the function running with both "\r\n" as well as just "\n" but worth a try. Also, thinking about it, no need for any line breaks after "... charset=iso-8859-1" I also have the function working with on one of my sites, change version to suit ...
Using the mail function with PHP is a little simpler than most people first think. Take a look over these PHP mail instructions. They will probably help you out.
http://danltn.com/bin/o0q.phps Example usage: <?php $mail = new email; $mail->html_mail()->to('email@gmail.com')->subject('Hello')->message('Hello there <b>Person</b>. How are you?')->from('email@ymail.com')->header('Reply-To: reply@email.com')->send(); PHP:
<?php $first_name = $_POST['firstname']; $company_name = $_POST['companyname']; $email = $_POST['emailaddress']; $phone_no = $_POST['phone_no']; $qstntype = $_POST['qstntype']; $country = $_POST['country']; $enquiry = $_POST['enquiry']; $mail_content ="<html> <head> <title></title> <style type='text/css'> .spanclassnrml{ font-family:Arial; font-size:12px; color:#000000; } .tableclass{ background-color:#CCCCCC; font-family:Arial; font-size:12px; font-style:normal; color:#000000; } .rowclass{ background-color:#FFFFFF; } .tdheadclass{ width:25%; } </style> </head> <body> <span class='spanclassnrml'><b>Dear Administrator</b>,</span><br /><br /> <span class='spanclassnrml'>You have received an enquiry from <b>$first_name</b></span> <br /> <br /> <table class='tableclass' cellpadding='5' cellspacing='1' width=70%> <tr class='rowclass'> <td class='tdheadclass'><b>Company Name</b></td> <td>$company_name</td> </tr> <tr class='rowclass'> <td class='tdheadclass'><b>Country</b></td> <td>$country</td> </tr> <tr class='rowclass'> <td class='tdheadclass'><b>E-mail Address</b></td> <td>$email</td> </tr> <tr class='rowclass'> <td v><b>Phone #</b></td> <td>$phone_no</td> </tr> <tr class='rowclass'> <td v><b>Query Type</b></td> <td>$qstntype</td> </tr>"; if($enquiry!=""){ $mail_content .= "<tr class='rowclass'> <td class='tdheadclass'><b>Enquiry</b></td> <td>$enquiry</td> </tr>"; } $mail_content .= "</table><br /><br /> <span class='spanclassnrml'><b>Regards</b>,</span><br /> <span class='spanclassnrml'>$first_name.</span><br /><br /> <span class='spanclassnrml'><b>Note:</b> This is a system generated e-mail.</span></body>"; $to = "santhobs@gmail.com"; $from = "$email"; $subject = "Query from E5 Website | $first_name"; $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $mail_content, $headers); echo "Message Sent Successfully"; ?>