Jump to content

sending an email in php


SN1P3R_85

Recommended Posts

hey everyone, I am fairly new with using php, and felt the need to have an email sent for something on my website. If the email was sent, I had it print "the email was sent successfully" on the screen. It does this every time I send the code, but when i check my inbox, there is no email in it. I then made a test file, to see if there was something wrong with my code. The test file contains this:

 

<?php

$to = "my_email@hotmail.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>");

}

?>

 

 

I've ran this code several times, and havn't gotten an email :(. Every time I run it, I get the "Message successfully sent!", so I don't understand why I'm not recieving the email. Do any of you guys know what this might be? any help is appreciated.

 

-SN1P3R_85

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.