Sending email via PHP

Status
Not open for further replies.

kim_foxx

Member
Messages
84
Reaction score
0
Points
6
I used to be able to use the form on my website http://ateenslife.com/contact.html for users to send me emails but now out of nowhere no emails are being sent. If i upload the same form on another webhost it works. Just wondering what is going on?
 

Derek

Community Support Force
Community Support
Messages
12,882
Reaction score
186
Points
63
Does it require mysql?
 

kim_foxx

Member
Messages
84
Reaction score
0
Points
6
Nope. The code can be found below.

PHP:
<?php 
	

function is_valid_email($from_email)
{
    return preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s\'"<>]+\.+[a-z]{2,6}))$#si', $from_email);
} 



$to_email = "xxxxxx@hotmail.com";
$subject = "A Teens Life";
$name.=$_POST['name']."\n" ;
$from_email.=$_POST['from_email']."\n" ;
$msg.=$_POST['message']."\n" ;


$message = "

    Name:
    $name

    Email:
    $from_email

    Message:
    $msg


";
    
	
$sent = mail($to_email, $subject, $message) ;
if($sent)
{print "Your mail was sent successfully."; }

else
{print "We encountered an error sending your mail"; }

?>
  </p>
  <p><br>
    <a href="contact.html">Click here to go back to the previous page </a></p>
 
Status
Not open for further replies.
Top