Jump to content

Mail function problems


poison6feet

Recommended Posts

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);

 

 

  }

Link to comment
https://forums.phpfreaks.com/topic/164789-mail-function-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.