SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Threaded View

  1. #1
    SitePoint Zealot 8Observer8's Avatar
    Join Date
    Jul 2013
    Location
    Russia
    Posts
    102
    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.


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
  •