+ Reply to Thread
Results 1 to 5 of 5

Thread: PHP Mail()

  1. #1
    nostradamus is offline x10Hosting Member nostradamus is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    8

    PHP Mail()

    Hi, all. I'm a bit confused about PHP's mail() function. Can someone help me figure it out? I've a few questions.

    I've read many tutorials about mail() already, and they still haven't been able to help me fully understand the process.

    I'm running WAMP and am using localhost to test PHP scripts. From what I've heard of mail(), I need a mail server to send mails from scripts.

    - I do not want to use my ISPs mail server.

    - I want to be able to write out my mail() script, and send it off.

    - Can I use AOL's mail server to send off mails from my scripts? If so, how is this done? What should I change in my php.ini file?

    Thank you.

  2. #2
    cybrax's Avatar
    cybrax is offline x10 Elder cybrax is on a distinguished road
    Join Date
    Aug 2009
    Location
    UK
    Posts
    699

    Re: PHP Mail()

    Don't believe that free hosting accounts can actually make changes to the php.ini file, not that you actually need to do this in order to send mail using the 'built in' php mail function. It's all quite painless code.
    HTML Code:
    <?php
    $to = "someone@example.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "someonelse@example.com";
    $headers = "From: $from";
    mail($to,$subject,$message,$headers);
    echo "Mail Sent.";
    ?>
    Above Source From W3 Schools

    What I will say however is that the x10 servers are a little 'quirky' depending upon other users demands throughout the day, but it has been getting better.. Sometimes email may take a long time to send or often not send at all.

    A more reliable method is to use a mail Class script that will 'talk' to a more reliable email service like Gmail.. Email mail() Alternative and let them handle the mail for free.

    You would need to read any documentation you can find for that link above to figure out if anybody has had it working with AOhell
    The code must flow.
    Project 157: Latest UK Jobs direct to your mobile phone
    New Domain under construction: Lovelogic.net
    home for some new projects that we can't keep here ;)


  3. #3
    nostradamus is offline x10Hosting Member nostradamus is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    8

    Re: PHP Mail()

    Thanks for your reply Cybrax.

    I actually changed the SMTP section of the php.ini file to point to my web hosts mail server, but now I get this error when I try to execute my mail script:

    Warning: mail() [function.mail]: SMTP server response: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1) in...

    From what I've read about this specific error message, I need authentication; apparently the mail server needs authentication for me to send mails by PHP.

    - Is there a way to authenticate without using a program such a PEAR?
    - How do I know if PEAR is already installed?
    - How do I use PEAR to authenticate/send emails by PHP?

    I am running a Windows Vista.

    Thanks.

  4. #4
    cybrax's Avatar
    cybrax is offline x10 Elder cybrax is on a distinguished road
    Join Date
    Aug 2009
    Location
    UK
    Posts
    699

    Re: PHP Mail()

    Sounds like improper setup of smtp settings for outgoing mail. error 550 = bad domain ?


    Check you have authentication turned ON for the outgoing mail. Go into the advanced settings and for the outgoing server, and check "Outgoing server requires authentication, use same settings as incoming server" - that might cure it.
    The code must flow.
    Project 157: Latest UK Jobs direct to your mobile phone
    New Domain under construction: Lovelogic.net
    home for some new projects that we can't keep here ;)


  5. #5
    nostradamus is offline x10Hosting Member nostradamus is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    8

    Re: PHP Mail()

    Where is the advanced settings? Is it located in cpanel, because I see where it says Advanced Settings in the Email Authentication option, but it does not say anything about the outgoing server. There's no option to check something like that.

+ Reply to Thread

Similar Threads

  1. Replies: 4
    Last Post: 10-16-2010, 02:01 AM
  2. Replies: 1
    Last Post: 10-04-2010, 02:46 PM
  3. form mail problem - sends but can't receive mail
    By scotlundy in forum Free Hosting
    Replies: 0
    Last Post: 02-11-2010, 10:04 AM
  4. Replies: 1
    Last Post: 09-30-2009, 10:52 AM
  5. Replies: 3
    Last Post: 12-03-2007, 08:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers