PHP Email Not Work -
i have website wherein can inquiry or leave questions , comments , send via email, code runs doesn't send email. here code:
$myemail = 'albertdaracan@gmail.com';//<-----put email address here. $fname = "albert"; $lname = "daracan"; $subject = "magosaburo inquery form"; $email_address = $_post['email']; $message = "name: ".$fname." ".$lname; $message = "test"; $to = $myemail; $email_subject = $subject; $email_body = $message; $headers = "from: $fname $lname <$email_address>\n"; $headers .= "cc: "; $headers .= "reply-to: $email_address"; //redirect 'thank you' page if(mail($to,$email_subject,$email_body,$headers)){ echo "mail successful send"; }else{ echo "could not send mail, please try again later"; } $message2 = "test"; $to2 = $email_address; $email_subject2 = "magosaburo"; $email_body2 = "$message2"; $headers2 = "from: magosaburo <$myemail>\n"; $headers2 .= "reply-to: $email_address"; //redirect 'thank you' page if(mail($to2,$email_subject2,$email_body2,$headers2)){ echo "mail successful send"; }else{ echo "could not send mail, please try again later"; }
my other works fine send email, in other server...
why not try fix issue first
$fname = "albert" //missing semi colon $lname = "daracan" //missing semi colon
$subject = "magosaburo inquery form"; //terminated here
may values not assigned causes faultness
Comments
Post a Comment