shiyou Posted July 20, 2007 Share Posted July 20, 2007 I have some problem in sending emails from the website back to my email address. I am not sure is there anything to do with the incoming server port. Because usually it is set to 110, but my this email is set to 9000. I tried using normal php mail function and PHPMailer. $to='me@mycompanyemail.com'; $subject='Testing email'; $message='Just a testing email'; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: <'.$email.'>' . "\r\n"; if ($strmail=mail($to, $subject, $message, $headers)) { echo "sucessful"; } else { echo "Error email"; } The outcome of this is sucessful, but I didn't receive any email from my inbox nor my junk mail. Where have my mail been? is there any way that I can do?? Please help!!! Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted July 20, 2007 Share Posted July 20, 2007 <?php // Send Email to confirm registration $mail_to=$_POST['email']; $mail_sub="Confirmed Registration"; // You must set a sender through message header $MsgHeader="From: Northern Knight"; // These two lines are required $MsgHeader .= "MIME-Version: 1.0\n"; $MsgHeader .= "Content-type: text/html; charset=us-ascii\n"; // Message body is HTML $MsgBody = " <html> <head> <title>Wwpknights Confirmed Registration</title> </head> <body> <h1>Confirmed Registration</h1> <p>Thank you for registering with wwpknights.com. You are now welcome to login and enjoy the benefits as a user. If you need help at any time please write to contact@thefilmgod.com or fill out a contact form on the website.</p> <p> Sincerely,<br> <strong>NorthernKnight</strong> </p> </body> </html>"; // Actual sending operation mail($mail_to, $mail_sub, $MsgBody, $MsgHeader); ?> Here is code from my website that works great! No problems. Quote Link to comment Share on other sites More sharing options...
samtay Posted July 20, 2007 Share Posted July 20, 2007 Maybe a stupid question but do you have a smtp server setup or in your php.ini a address to a remote smtp server? Samuel Quote Link to comment Share on other sites More sharing options...
phpknight Posted July 20, 2007 Share Posted July 20, 2007 Are you on a shared server? Sometimes bad hosts just quit sending email sometimes. As long as the function returns true, the call was okay. It should get to you. You might have to fix the headers. First, just try doing a mail call without the headers and see if that gets to you. Quote Link to comment Share on other sites More sharing options...
shiyou Posted July 26, 2007 Author Share Posted July 26, 2007 Maybe a stupid question but do you have a smtp server setup or in your php.ini a address to a remote smtp server? Samuel The server is not at my side, we are using other company web hosting. Where can I set up the smtp server setup or in your php.ini a address to a remote smtp server? 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.