php - web sms configuration - receiving unwanted information -


i using code below sending web mail , sms notifications. receive clients' names , enquiries in sms enquiry field not mandatory when user leaves blank receive header information. tried remove $header mail(..,..,$header) won't receive sms.

here php code:

if ($_post['submit']) { $to="myemailaddress@domain.com"; $sms="mymobilenumber@smsserviceprovider.com"; $subject=""; $from = "web@mywebsite.com"; $enquiry = $_request['enquiry'] ; $headers = "from: $from\r\n" . "mime-version: 1.0\r\n" . "content-type: multipart/mixed;\r\n" . " boundary=\"{$mime_boundary}\""; $message="$name $enquiry"; @mail($sms, $message, $headers); } 

the html code:

<form action="/thankyou.php" method="post" enctype="multipart/form-data" onsubmit="return validateform();" > <input type="text" name="name" /> <textarea name="enquiry"></textarea> <input type="submit" value="submit" onclick="javascript:return validatemyform();" /> </form> 

this when enquiry field left unanswered:

sbj: name enquiry from: web@mywebsite.com mime-versian:1.0 content-type:....

this want receive:

name enquiry

appreciate help

solved: ok here did solve issue: set new header sms below:

$header = "from: $from\r\n" . "content-type:text/plain;\r\n";  @mail($sms, $subject, $message, $header); @mail($to, $subject, $message, $headers); 


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -