poison6feet Posted July 4, 2009 Share Posted July 4, 2009 Hi Guys, Recently I have moved my website from VPS to hosting only and I am unable to figure why email is not going out. I have a code, when user gets registered, system will send automatic email with all the details. Registration part if($database->addNewUser($subuser, md5($subpass), $subname, $subemail)){ if(EMAIL_WELCOME){ $mailer->sendWelcome($subname, $subuser,$subemail,$subpass, EMAIL_FROM_ADDR); } When I echo message before and after calling the sednWelcome function, Its displaying the message but I am not sure why it is not entering in the mailer.php mailer.php function sendWelcome($name, $user, $email, $pass, $from){ require_once "Mail.php"; $subject = "Welcome!"; $body = $name.",\n\n" ."Welcome! You've just registered at Imitigence Site " ."with the following information:\n\n" ."Body Message xxxxx" ."- Administrator,\n" ."Imitigence."; $to = $email; $host = "host"; $username = "xxxxxxxx"; $password = "xxxxxxxx"; $headers = array ('From' => $from,'To' => $to,'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host,'auth' => true,'username' => $username,'password' => $password)); $mail = $smtp->send($to, $headers, $body); } Quote Link to comment Share on other sites More sharing options...
Bendude14 Posted July 5, 2009 Share Posted July 5, 2009 last time i had a problem it was becuase my new server required the 5th parameter to the mail function... check it out here http://au2.php.net/manual/en/function.mail.php Quote Link to comment Share on other sites More sharing options...
poison6feet Posted July 5, 2009 Author Share Posted July 5, 2009 5th parameters or 4 parameters, however in the mentioned url the fifth parameter is optional, I am not sure, I have raised the ticket with the hosting company and they said that will look in to the email logs and come back with some advise. Thanks Quote Link to comment Share on other sites More sharing options...
Bendude14 Posted July 6, 2009 Share Posted July 6, 2009 5th parameter, optional by PHP but not always optional by the server,, well thats what my hosting company told me... 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.