Jump to content

PHP Mail & SMS Script


Recommended Posts


so I have input form for feedback with php mail send but i also want to send a sms message to user.

This is html:
<div class="fs-form-wrap" id="fs-form-wrap">

<form id="form" class="fs-form fs-form-full" action="#" method="post" autocomplete="off">
<ol class="fs-fields">
<label class="fs-field-label fs-anim-upper" for=Name?</label>
<input class="fs-anim-lower" id="q1" name="q1" type="text" placeholder="Name" required/>
<label class="fs-field-label fs-anim-upper" for="q2" data-info="Vaild eamil....?</label>
<input class="fs-anim-lower" id="q2" name="q2" type="email" placeholder="email@email.com" required/>

<label class="fs-field-label fs-anim-upper" for="q3" data-info="Valid phone number">Phone number...?</label>
<input onkeypress='return event.charCode >= 48 && event.charCode <= 57' class="fs-anim-lower" id="q3" name="q3" type="text" maxlength="10" placeholder="09x-xxx-xxxx" required/>
<label class="fs-field-label fs-anim-upper" for="q4" data-info="What do you think about our servise?">Feedback</label>
<textarea class="fs-anim-lower" id="q4" name="q4" placeholder="Feedback.."></textarea>
</ol><!-- /fs-fields -->
<button class="fs-submit" type="submit" name="submit" id="send" >Send</button>


This is php mail:

//Checking for blank Fields..
echo "Fill everything..";
// Check if the "Sender's Email" input field is filled out

// Sanitize e-mail address
$email =filter_var($email, FILTER_SANITIZE_EMAIL);

// Validate e-mail address
$email= filter_var($email, FILTER_VALIDATE_EMAIL);

if (!$email){
echo "Invalid Sender's Email";
$subject = $_POST['q3'];

$message = 'Name: ' . $_POST['q1'] . ' Email: ' . $_POST['q2'] . ' Phone Number: ' . $_POST['q3'] . ' Feedback: ' . $_POST['q4'];

$headers = 'From:'. $email . "\r\n"; // Sender's Email

// message lines should not exceed 70 characters (PHP rule), so wrap it
$message = wordwrap($message, 70);

// Send mail by PHP Mail Function
mail("myemail@mydomain.com", $subject, $message, $headers);
echo "Thank you for feedback";

I have public sms getaway on my computer so when user input his phone script make link like this "http://mysmsgetaway.com?PhoneNumber=user-phone-number&Text=message-from-us" and it goes to my getaway..

Thank you

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

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

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.