PHP Email - Not Being Sent

Discussion in 'Email' started by Soccerguy951, Sep 11, 2015.

  1. Like others, I put in the test email code, but i'm also having the issue of my email not being sent.

    What is the mail.php file that is required. I've seen others ask this on the forum, but no response was given.

    I'm using the test code, just updated with my information (my info is not posted.).

    Can someone help with this?

    <?php

    require_once "Mail.php";
    $from = "Sender <[email protected]>";
    $to = "Recipient <[email protected]>";
    $subject = "This is a test email sent via php";
    $body = "This is a test email";
    $host = "mail.HostingAccountDomain.com";
    $username = "[email protected]";
    $password = "email_password";
    $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);



    ?>
     
  2. At first i was getting errors, because i didn't have my email password. Once i put i the correct password, i stopped getting the errors, but no email was sent.
     

Share This Page