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 5 of 5

Thread: Email script

  1. #1
    New Coder
    Join Date
    Aug 2009
    Posts
    84
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Email script

    Hi i have this php mail script and it says message sent successfuly but i never recieve the message.
    any help apreciated.

    i know my email address needs to go where "you@someone.com" is so thats not the problem.
    code:

    <?php
    $to = "you@someone.com";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";
    if (mail($to, $subject, $body)) {
    echo("<p>Message successfully sent!</p>");
    } else {
    echo("<p>Message delivery failed...</p>");
    }
    ?>

  • #2
    New Coder
    Join Date
    Sep 2009
    Location
    Portugal/Porto
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hi;

    I use this and it works fine....

    Code:
    <?
    $recipient = "yourmail@else.com";
    $subject = "Hi";
    
    $mssg = "
    $mssg .= "the message\n";
    $mssg .= "";
    
    mail($recipient, $subject, $mssg, $mailheaders) or die ("Could't send message");
    ?>
    
    <?
    echo "Sucess";
    ?>

  • #3
    Regular Coder
    Join Date
    Mar 2006
    Posts
    238
    Thanks
    3
    Thanked 37 Times in 37 Posts
    Quote Originally Posted by alcool9999 View Post
    <?php
    $to = "you@someone.com";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";
    if (mail($to, $subject, $body)) {
    echo("<p>Message successfully sent!</p>");
    } else {
    echo("<p>Message delivery failed...</p>");
    }
    ?>
    This your script worked form me too. I have sent an e-mail to my gmail e-mail address. I have received it but found it in the "Spam" folder. I think probably because "From" and "Reply-To" headers have been absent. Or maybe the message has been too short.

    Anyway, if you have a spam-filter, I would check if it did not cut the message ... It could be quite probable that the message is sent but you do not see it due to a spam filter... At least the script worked for me in this way.

  • #4
    New Coder
    Join Date
    Jul 2009
    Posts
    91
    Thanks
    5
    Thanked 6 Times in 6 Posts
    If you suspect it may be being blocked by anti-spam feel free to fire it to me at:

    cf13092009@wibblywobblyteapot.co.uk

    Make a note of the time when you do it, and I'll tell you if it's getting killed by something like an RBL or Spamassassin based device.

    I love spam myself, I just don't get it any more :-)

  • #5
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi alcool9999,

    This may script may help you,
    Use this and try ,

    $mail_to="to@example.com";
    $mail_from = "from@example.com";
    $mail_sub = "sample"; // The Subject of the email
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= "From: $mail_from";
    $mail_mesg ="some text ";
    mail($mail_to,$mail_sub,$mail_mesg,$headers);

    You have not mentioned the header in the parameters.

    Thanks
    Last edited by JohnDubya; 09-22-2009 at 04:21 PM. Reason: Removed advertisement links


  •  

    Posting Permissions

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