Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Smtp

  1. #11
    Join Date
    Oct 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hey,

    i'm facing sor of the same problem as InNeedOfHelp, i'm doing a web project using my laptop at home. I need to test it which include sending of mail to user. However, i want to use a remote smtp server to deal with forwarding my mail to hotmail or yahoo.

    i change my php.ini into:


    [mail function]
    ; For Win32 only.
    SMTP = smtp.net (smtp server i wan to make use of)
    smtp_port = 25


    ; For Win32 only.
    ;sendmail_from = mymail@hotmail.com

    what else did i lack of, assuming my coding to send a simple mail is error-free??

    tnx alot in advance

  2. #12
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    what else did i lack of, assuming my coding to send a simple mail is error-free??
    You forgot to uncomment the sendmail_from line.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #13
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    You might be able to find and install a Windows SMTP server, but I've never seen one.
    hMailServer is a free, fully functional mail server for Windows. Pretty simple to install and use.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  4. #14
    Join Date
    Oct 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oya, wad a silly mistakes i shall go try later.

    hey testingsite, but i don wan to install any mail server in my laptop, i wanna use the smtp server which eventually i have to make use of in future.

    So other den the php.ini file, is there any xtra codings needed??

  5. #15
    Join Date
    Oct 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm having a rather same scenerio here for weeks without getting a feasible solution, can any1 help me with this?? As i'm totally new to PHP, i tried many methods found online but got stuck at some stage e.g changing php.ini, using swiftmailer etc. So can any1 guide me along, assuming i jux installed my php and did nth to it...really apreciate it

    You see, i'm currently working on a web application which involve sending emails to user. I'm using windowXP SP2, with apache installed incorporate with MySQL as my server. Rite now my code for sending the mail is :


    <?php
    require_once "Mail.php";

    $from = "Sandra Sender <sender@example.com>";
    $to = "Ramona Recipient <recipient@example.com>";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";

    $host = "smtp.yahoo.com";
    $username = "smtp_username";
    $password = "smtp_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);

    if (PEAR::isError($mail)) {
    echo("<p>" . $mail->getMessage() . "</p>");
    } else {
    echo("<p>Message successfully sent!</p>");
    }
    ?>


    As you can see, i'm trying to use yahoo as my external smtp mail server to help send my mail to my application end user.


    Any guidance plss??? tnx alot

Bookmarks

Posting Permissions

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