Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,097
    Thanks
    15
    Thanked 1 Time in 1 Post

    Question sending email with SMTP authentication (on port 26)

    I am looking to send email in my script and go through my mail account with my host (Turtle Hosting).

    However, I am currently getting an error as shown at:
    http://www.ayrshireminis.com/email.php

    Code:
    Warning: main(Mail.php) [function.main]: failed to open stream: No such file or directory in /home/ayrshire/public_html/email.php on line 2
    
    Fatal error: main() [function.require]: Failed opening required 'Mail.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ayrshire/public_html/email.php on line 2

    PHP Code:
    <?
    include(“Mail.php”);
    /* mail setup recipients, subject etc */
    $recipients “feedback@yourdot.com”;
    $headers[“From”] = “user@somewhere.com”;
    $headers[“To”] = “feedback@yourdot.com”;
    $headers[“Subject”] = “User feedback”;
    $mailmsg “HelloThis is a test.;
    /* SMTP server name, port, user/passwd */
    $smtpinfo[“host”] = “smtp.mycorp.com”;
    $smtpinfo[“port”] = “25&#8243;;
    $smtpinfo[“auth”] = true;
    $smtpinfo[“username”] = “smtpusername”;
    $smtpinfo[“password”] = “smtpPassword”;
    /* Create the mail object using the Mail::factory method */
    $mail_object =& Mail::factory(“smtp”$smtpinfo);
    /* Ok send mail */
    $mail_object->send($recipients$headers$mailmsg);
    ?>
    I know my host supports PHP PEAR, I have a ".pearrc" file in my root directory and also a PEAR Installer - however, there doesn't appear to be anything mentioning Email.

    Cheers,
    Picco

  • #2
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,097
    Thanks
    15
    Thanked 1 Time in 1 Post
    if there is any other way to send an email with PHP through a server that requires authentication (through port 26) then that would be good too?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •