PHP email

Discussion in 'Email' started by Raul Corado, Sep 24, 2017.

Tags:
  1. Hi guys! I have this php in my hosting:

    <html>
    <head><title>Test email via php</title></head>
    <body>
    <?php
    ini_set('display_errors',1);
    require_once "Mail.php";
    $from = "Sender <projabc@informacionabc.org.gt>";
    $to = "Recipient <projabc@gmail.com>";
    $subject = "This is a test email sent via php";
    $body = "This is a test email";
    $port = "25";
    $host = "mail.informacionabc.org.gt";
    $username = "projabc@informacionabc.org.gt";
    $password = "projabcpassword123";
    $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);
    ?>
    </body>
    </html>


    explorer displays :

    Warning: require_once(Mail.php): failed to open stream: No such file or directory in E:\web\projabc\smtp\index.php on line 6

    Fatal error: require_once(): Failed opening required 'Mail.php' (include_path='.;C:\php\pear') in E:\web\projabc\smtp\index.php on line 6



    Should I write some additional path in the require_once command?

    Or maybe I should copy some pear directory in the project folder?

    Thank you very much !
     
  2. Elshadriel

    Elshadriel Winhost Staff

    Unfortunately, PEAR is not installed, but here are instructions on how to install it to your hosting account.
     
    Michael likes this.

Share This Page