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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Location
    India
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Email not delivering....

    This is my code .It is executing and not showing any error messages, but email is not delivering ..

    Cud any one of you please contibute your valuble time for me???
    I am using PHP 4.3.10 , Mysql 4.1.9 with windows server. Is there any need to change the ini settings.If so, cud u intimate me what should i change??


    <?php
    mail(
    "purush2purush@yahoo.co.in", // E-Mail address
    "Hay.......", // Subject
    "Thanks 4 ur help???", // Message
    "From: mahela <mahela@yahoo.co.in>\r\nReply-to: jaswani <jaswani@hotmail.com>");
    echo "Mail Sent Sucessfully";
    ?>

    Thanks & regards,
    Purush.
    Last edited by purush2purush; 07-03-2007 at 05:43 AM.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Try
    PHP Code:
    <?php
    $email 
    "you@domain.com";
    $subject "Hay";
    $message "Thanks 4 ur help???";
    $headers  "From: mahela <someone@yahoo.co.in>\r\n";
    $headers .= "Reply-to: jaswani <someone@hotmail.com>";

    // this statement below is called a ternary conditional
    echo (mail($email,$subject,$message,$headers)) ? 'Mail Sent Successfully' 'Mail sending has failed';
    ?>
    More info on ternary here: http://www.ilovejackdaniels.com/php/...-conditionals/

    If the above doesn't work then your host may have disabled the mail function. Many free webhosts do this often.

    Note: I've removed the emails from the post I made to prevent spam, I suggest you do the same.
    Last edited by _Aerospace_Eng_; 07-03-2007 at 06:11 AM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Location
    India
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks 4 ur kind help...Even then not working..

    Tried with the code you suggested..Then the following error message is displayed...


    Warning: mail(): SMTP server response: 530 5.7.0 Must issue a STARTTLS command first y25sm7200507pod in c:\program files\php\www\testtest.php on line 9
    Mail sending has failed


    Will be greatful..If i get reply ..

    Thanks & regards,
    Purush..

  • #4
    New to the CF scene
    Join Date
    Jul 2007
    Location
    India
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hay ..cud any one plz solve this problem..

    I even upgraded my Php..Even then mail is not able to sent.


    I am trying to send through gmail with smtp.gmail.com
    Last edited by purush2purush; 07-04-2007 at 11:22 AM.

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,036
    Thanks
    2
    Thanked 316 Times in 308 Posts
    Please read the information at this link on how to connect and send mail through gmail - http://mail.google.com/support/bin/a...y?answer=13287

    You need to use SMTP authentication and connect through an SSL port.

    The PHP mail(...) function does not support SMTP authentication. You would need to use the phpmailer class or other mail class that supports authentication.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #6
    New to the CF scene
    Join Date
    Jul 2007
    Location
    India
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tanxs for ur help..

    Even a small help for One,may become a great help for others..

    Very very thanks for your help...


    Thanks & regards,
    Purush.


  •  

    Posting Permissions

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