simple php mail function problem result getting something went wrong

<?php $norg = $_POST['norg']; $add_tel = $_POST['add_tel']; $contact_mob = $_POST['contact_mob']; $message = $_POST['message']; $norg = stripslashes(strip_tags($norg)); $add_tel = stripslashes(strip_tags($add_tel)); $contact_mob = stripslashes(strip_tags($contact_mob)); $message = stripslashes(strip_tags($message)); $m1 = " message from example.com

contact form Details are Below

Name of Organization :". $norg ."
Address, Tel. No / Fax No.s & Email : ".$add_tel."
Contact Person / Mobile No :".$contact_mob."
Message :".$message ."
"; $m_ad = "[email protected]"; $subj = "from example.com"; $incoming_thanks = "http://www.example.com"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; if(mail($m_ad, $subj, $m1, $headers)) {echo "mail has been sent"; } else { echo "something went wrong"; }

help!

getting something went wrong?

More details than a code dump and help will illicit better responses.

i’m new in this forum! so! in my code what went wrong! please help! mail function not working is that problem for to any settings in cpanel! or what

CPanel is a program. It has nothing to do with anything.

mail() is notoriously problematic. If it sends, it usually goes to junk folders.

PHPMailer, Swift Mailer, MailGun…

You have no form, therefore there are no POST values. Learn how to make a proper form. You have variables that just magically appear. If you had error reporting turned on you would be getting several error messages.

hi form in html file…and post to php it solved by using example.com instead of gmail.com

Sponsor our Newsletter | Privacy Policy | Terms of Service