SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Aug 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy How to Send mail() using EasyPHP

    Hi,
    I am new to php. I heard about the mail function in php.
    I thoght that i could send mail with out logining in to my account.
    i thoght it was great.but when i tried to send mail. that is i woke from the dream.
    My friend said me to use Easyphp. So i ahve downloaded it and insatlled it.

    CODE:
    <?php
    echo "<html><body>";
    mail ("p.tamilselvan@gmail.com", "Subject", "Hello!");
    echo "Sending mail...";
    echo "</body></html>";
    ?>

    ERROR:

    Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in d:\easyphp\www\mail_test.php on line 3


    Want to know ur IP ANd other details.



    CONFIGURING php.ini (Setting the SMTP)!!!
    I want to send a mail via php mail function.
    When ever i send a mail from the php mail().
    The following error comes.And i could not send any mail.
    Please help me in configuring the php.ini.
    And what values should be set in

    smtp=?
    smtp_port=?
    sendmail_from=?

    My Actual php.ini is
    [mail function]
    ; For Win32 only.
    SMTP = localhost
    smtp_port = 25
    ; For Win32 only.
    sendmail_from = me@localhost.com

    A few guys gave advice to save the SMTP to my ISP provider i did so.

    Then when i sent mail.
    The following error came.

    Warning: mail(): SMTP server response: 550 5.7.1 Relaying not allowed: p.tamilselvan@gmail.com in d:\easyphp\www\mail_test.php on line 3


    Please Reply the changes
    Thanks in advance.
    TaM

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In php.ini change:
    SMTP = localhost
    to:
    SMTP = your.isp.smtp.com

    i.e use your ISP's smtp server, the same server you entered when setting up an outlook/outlook express account for example. Your ISP's homepage should tel you what the smtp server(s) are if you don't know.

    Set sendmail_from to whatever email address you want on outgoing emails, for example:
    sendmail_from = p.tamilselvan@gmail.com

  3. #3
    SitePoint Member
    Join Date
    Aug 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello dude,
    i have configured the smtp sever in outlook express and send/ receive mail from it.

    but when i use the same smtp server in the php.ini

    the mail is not going and reporting the following error

    My Actual php.ini is
    [mail function]
    ; For Win32 only.
    SMTP = smra.sancharnet.in
    smtp_port = 25
    ; For Win32 only.
    sendmail_from = me@localhost.com

    A few guys gave advice to save the SMTP to my ISP provider i did so.

    Then when i sent mail.
    The following error came.

    Warning: mail(): SMTP server response: 550 5.7.1 Relaying not allowed: p.tamilselvan@gmail.com in d:\easyphp\www\mail_test.php on line 3


    Please Reply the changes
    Thanks in advance.
    TaM

  4. #4
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure sendmail_from is set to the email address your ISP gave you, e.g yourname@sancharnet.in or whatever it is

  5. #5
    SitePoint Evangelist Daijoubu's Avatar
    Join Date
    Oct 2002
    Location
    Canada QC
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    gmail use authentification and SSL, I doubt you can use that with PHP
    Don't your ISP provide a mail/SMTP server?
    Speed & scalability in mind...
    If you find my reply helpful, fell free to give me a point


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
  •