Mail sending problem in Mail.php

Discussion in 'PHP' started by jasvarghese, Aug 24, 2007.

  1. #1
    Hai All,

    i am a newbie to php. I created code to send mail and when i am trying to send it its throwing an error like

    Warning: require_once(Mail.php) [function.require-once]: failed to open stream: No such file or directory in D:\hosting\member\xentaqsys\testsite\sampleTwo\user\index.php on line 35

    Fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='.;C:\php5\pear') in D:\hosting\member\xentaqsys\testsite\sampleTwo\user\index.php on line 35

    Why its happening?
    The site is hosted in an IIS server. If anyone know the solution pls let me know as early as possible. I am in a hurry to get the solution for the same. how cold i rectify this. All the helps would be greatly appreciated.

    Thanks & regards
    jaison
     
    jasvarghese, Aug 24, 2007 IP
  2. jasvarghese

    jasvarghese Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Here i'm placing the code...


    require_once "Mail.php";

    $recipients = "jasvarghese@gmail.com";
    $headers["From"] = "mail@mySite.com";
    $headers["To"] = "contact@mySite.com";
    $headers["Subject"] = "User feedback";
    $mailmsg = "Hello, This is a test.";
    // SMTP server name, port, user/passwd
    $smtpinfo["host"] = "hostName";
    $smtpinfo["port"] = "25";
    $smtpinfo["auth"] = true;
    $smtpinfo["username"] = "mail@mySite.com";
    $smtpinfo["password"] = "*****";
    // Create the mail object using the Mail::factory method
    $mail_object =& Mail::factory("smtp", $smtpinfo);
    // Ok send mail
    $mail_object->mail($recipients, $headers, $mailmsg);



    This is an alternate code which i tried

    mail('jasvarghese@gmail.com', 'My Subject', $message);

    This is also not working...

    Is there any problem with the hosting????
    if so wat should i do to rectify it???
     
    jasvarghese, Aug 24, 2007 IP