SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot 8Observer8's Avatar
    Join Date
    Jul 2013
    Location
    Russia
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I cannot to send an email to myself.

    Hi,

    I want to send an email to myself. But I don't receive it.

    Code:
    <?php
    
    $to = '**********@gmail.com';
    $subject = 'This is an email.';
    $body = 'This is a test email'."\n\n".'Hope you got it';
    $headers = 'From: someone@gmail.com';
    
    if (mail($to, $subject, $body, $headers)) {
        echo 'Email has been sent to '.$to;
    } else {
        echo 'There was an error sending the email.';
    }
    ?>
    Output:
    Email has been sent to **********@gmail.com
    Thank you!
    Last edited by Mittineague; Sep 12, 2013 at 09:54.

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2006
    Location
    Nantwich, Cheshire
    Posts
    458
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Does it work if you send it to someone else? Is it being trapped by junk traps? Is the 'from' address valid (assuming gmail checks that kind of thing)?
    http://www.firenza.net - my homage to a car from the 1970s

  3. #3
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,077
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Try adding the email address it's being sent from to your list of contacts
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  4. #4
    SitePoint Zealot 8Observer8's Avatar
    Join Date
    Jul 2013
    Location
    Russia
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you! I conjecture that is some kind of a spam buster. Yes?

  5. #5
    SitePoint Zealot 8Observer8's Avatar
    Join Date
    Jul 2013
    Location
    Russia
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much. I will try it


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
  •