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
Share on other sites

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.