email script not working.

Discussion in 'HTML / PHP / JavaScript / CSS' started by bjinecs, Nov 4, 2016.

  1. I'm migrating a classic asp site to php. I copied the send script from the forum and changed it as directed(I think).

    The script executes without any errors, but the email never shows up either on the smarter email inbox or my email. I copied the site postmaster and sent the email to myself. Here is the script, password not included. I will include it if you ask for it.


    <?php
    echo " ************** TEST EMAIL ***************<br>";
    echo date('l jS \of F Y h:i:s A')."<br>"; //to insure script gets executed
    require_once "Mail.php";
    $from = "Sender <[email protected]>";
    $to = "Dan <[email protected]>";
    $cc = "[email protected]";
    $subject = "This is a test email sent via php";
    $body = "This is a test email";
    $host = "smtp.highschooledu2.org";
    $username = "[email protected]";
    $password = "furnish on request";
    $headers = array ('From' => $from,
    'To' => $to,
    'cc' => $cc,
    'Subject' => $subject);
    $smtp = Mail::factory('smtp',
    array ('host' => $host,
    'auth' => true,
    'username' => $username,
    'password' => $password));
    $mail = $smtp->send($to, $headers, $body);echo "mail sent<br />";
    echo " ************** END EMAIL TEST ***************<br>";
    ?>
     
    Last edited: Nov 4, 2016
  2. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    mjp likes this.
  3. The hosting provider (DiscountAsp) says PEAR is installed; do I need a require file?
    I tried require PEAR.php.
     
    Last edited: Nov 5, 2016
  4. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

  5. Thank you, SOAP was installed one version 5.4, but not on others, I will install on 7.0.
    Also, I was using AODB with MS Access, and it seems to occasionally clobber parts of the html.
    I am going to try using PDO instead, but do you know anything about the AODB problem?
     
  6. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    Sorry, no. I don't work with Microsoft Access much these days. You might want to consider upgrading to SQL.
     
  7. mjp

    mjp

    Access was never intended to be used on the web, for what it's worth. Access is a desktop database, and if you hit it too hard (as you can easily do on a website) it's almost guaranteed to fail, or, as you said, clobber things.

    At first glance MS SQL is going to seem more complicated to implement and use - and it is, honestly - but the fundamentals are pretty much the same, and in the long run it will be worth the learning curve to upgrade.
     
    RayH likes this.

Share This Page