Search the Community

Showing results for tags 'email'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 34 results

  1. Hi. I am relatively new to using PHP and am working on building a contact form. It's pretty much good to go and it sends to my email, however, I am having the issue where it just sends this information to my email and not what the user put in, just leaving the message blank. Name: Email: Phone: Message: I'm not exactly sure what I am doing incorrectly. Also is there way to improve my code to make sure it gets in my inbox and not my spam? I've included the PHP and the HTML regarding the form. Here's the PHP. <?php $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; $formcontent=" From: $name \n Email: $email \n Phone: $phone \n Message: $message"; $recipient = "contact@immersivewebdesign.com"; $subject = "Contact Form"; $mailheader = "From: $email \r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("Error!"); echo "Thank You!" . " -" . "<a href='http://immersivewebdesign.com/' style='text-decoration:none;color:#ff0099;'> Return Home</a>"; ?> Here's the HTML form. <div class="container"> <div class="col-lg-offset-4 col-lg-4" id="panel"> <h2>Get In Touch</h2> <form action="mail.php" method="post"> <div class="group"> <input type="text" name="name" required> <span class="highlight"></span> <span class="bar"></span> <label>Name</label> </div> <div class="group"> <input type="email" email="email" required> <span class="highlight"></span> <span class="bar"></span> <label>Email</label> </div> <div class="group"> <input type="tel" phone="phone" required> <span class="highlight"></span> <span class="bar"></span> <label>Phone</label> </div> <div class="group"> <input type="text" message="message" required> <span class="highlight"></span> <span class="bar"></span> <label>Message</label> </div> <div class="group"> <center> <button type="submit" class="btn btn-warning">Send <span class="glyphicon glyphicon-send"></span></button></center> </div> </form> </div> </div> Thank you for your help.
  2. I have a php password reset form that when used many users do not receive the email: http://amac.us/member-login-help/ It works for most major email providers but AOL email and Apple email users don't receive them nor are the in their spam or junk folders. Any advice on how to fix this on going issue?
  3. My first question: I have a message like this: notice: undefined offset 0 I use an input form to check with dns_get_record and DNS_MX whether the domain of an email exists. I can check the emails if the domain does exist, but a wrong domain like: mail@verynonexistingdomain.com throws in the notice undefined offset 0 so does an empty input. <html> <center> <br> email input :<br> <form action="#" method = "post"> <input type ="text" name ="mail"> <br> <input type="submit" name = "click" value ="zend"> </form> <?php $domain =''; $data =''; var_dump($_POST['click']); var_dump($_POST['mail']); if (isset($_POST['mail'])) { echo $_POST['mail']; $input = $_POST['mail']; } // // function check_address($input){ list($user, $domain) = explode('@', $input); $data= dns_get_record($domain, DNS_MX); if($data[0]['host']==$domain&&!empty($data[0]['target'])) { return $data[0]['target']; } else { }} echo check_address($input); Echo '<br><br>'; echo $input . " : " ; if(check_address($input) ) { echo('<br>This MX records exists; I will accept this email as valid.<br> '); } else { echo('<br>No MX record exists; Invalid email.<br>'); } echo '</center>'; ?> </html> I had it working without the form part so with a constant variable, but when I added the form it threw the error. I tried several options, but cant find the logic behind executing a good input without throwing an error and a bad domain giving this notice. Anyone any idea?
  4. Hi Guys, I have a slight problem with some of my code. I have a series of tables running down a page with each table containing different data. All looks fine when I look at it as a HTML page but when I use it as an Email 2/3 elements move for some reason, is there a way I can make sure these elements won't move? The code is in the backend of a program I use and gets called as Emails are generated for different subjects. Thanks in advance, Craig.
  5. Hi, what is w3schools email address? office mail address, perhaps?
  6. Hi, I am using express framework form to get inputs from user and sending it as email by using node mailer. However i am unable to receive the image and system type (Combo box).I am new to node.kindly help. ### My HTML code ``` <div class="container"> <p style="font-size:24px;">ONLINE SUPPORT REQUEST</p> <hr size="2%;"width="50%;"> <form role="form" name="myForm" onsubmit="return(validate());" action="http://127.0.0.1:8081/process_post" method="POST" > <div class="form-group"> <label for="name">What is your name?</label> <input type="text" class="form-control" id="text" name="fname" placeholder="name"> </div> <div class="form-group"> <label for="cname">What is your company name?</label> <input type="text" class="form-control" id="text" name="cname" placeholder="company name"> </div> <div class="form-group"> <label for="email">What is your email address?</label> <input type="email" class="form-control" id="email" name="email" placeholder="Enter email"> </div> <div class="form-group"> <label for="phone">What is your phone number?</label> <input type="text" class="form-control" id="text" name="phone" placeholder=" phone number with area code"> </div> <div class="form-group"> <label for="one">Is this an emergency? </label> <input type="radio" class="form-control" id="text" name="emergency" value="No"> NO <input type="radio" class="form-control" id="text" name="emergency" value="Yes"> YES </div> <div class="form-group"> <label for="one">Do you require a phone call when we begin working on your ticket? </label> <input type="radio" class="form-control" id="text" name="phonecall" value="No"> NO <input type="radio" class="form-control" id="text" name="phonecall" value="Yes"> YES </div> <div class="form-group"> <label for="combo" name="systemtype"> What is your system platform</label> <br> <select> <option value="volvo">Microsoft Windows</option> <option value="saab">Mac OS X</option> <option value="opel">Linux</option> <option value="audi">IOS</option> <option value="5">Android</option> <option value="6">Others</option> </select> </div> <div class="form-group"> <label for="uploadfile"> Please attach a screenshot if applicable.</label> <input type="file" class="form-control" id="text" name="attachment" size="50"> <br> <input type="submit" value="Upload File" /> </div> <div class="form-group"> <label for="name">What is the subject of your support request?</label> <input type="text" class="form-control" id="text" name="supportrequest" placeholder="suport subject"> </div> <div class="form-group"> <label for="comment">Please describe the support issue in detail </label> <textarea class="form-control" rows="5" id="comment" name="urcomments"></textarea> </div> <button type="submit" class="btn btn-default">Submit</button> </form> </div> <br> ``` ### My server Code ```js var express = require('express'); var app = express(); var fs = require("fs"); var bodyParser = require('body-parser'); var multer = require('multer'); // Create application/x-www-form-urlencoded parser var urlencodedParser = bodyParser.urlencoded({ extended: false }) app.use(express.static('public')); var upload = multer({ dest: './uploads' }); app.get('/client-support.htm', function (req, res) { res.sendFile( __dirname + "/" + "client-support.htm" ); }) app.post('/process_post', urlencodedParser, function (req, res) { // Prepare output in JSON format response = { fname:req.body.fname, cname:req.body.cname, email:req.body.email, phone:req.body.phone, emergency:req.body.emergency, phonecall:req.body.phonecall, systemtype:req.body.systemtype, attachment:req.body.attachment, supportrequest:req.body.supportrequest, urcomments:req.body.urcomments }; console.log(response); res.end(JSON.stringify(response)); console.log(req.files.file.name); console.log(req.files.file.path); console.log(req.files.file.type); var file = __dirname + "/" + req.files.file.name; fs.readFile( req.files.file.path, function (err, data) { fs.writeFile(file, data, function (err) { if( err ){ console.log( err ); }else{ response = { message:'File uploaded successfully', filename:req.files.file.name }; } console.log( response ); res.end( JSON.stringify( response ) ); }); }); //sudan file upload edit end //sudan edited node mailer code below var nodemailer = require('nodemailer'); // create reusable transporter object using the default SMTP transport // setup e-mail data with unicode symbols var mailOptions = { from: 'xxxxxxxx.com', // sender address to: 'xxxxxxxxx.com', // list of receivers subject: 'Client Support Page - Client Details', // Subject line text: 'you have a new submission with folowwing details....Name:'+req.body.fname+'cname:'+req.body.cname+'Email:'+req.body.email+'Phone:'+req.body.phone+'emergency:'+req.body.emergency+'phonecall:'+req.body.phonecall+'systemtype:'+req.body.systemtype+'attachment:'+req.body.attachment+'supportrequest:'+req.body.supportrequest+'urcomments:'+req.body.urcomments, // plaintext body html: '<table border="1" style="width:100%"><tr style="background-color:#373737;color:#ffffff;"><td><b>DETAILS LIST</b></td><td><b>CLIENT DETAILS</b></td></tr><tr style="background-color: #eee;"><td><b>Name:</b></td><td>'+req.body.fname+'</td></tr><tr><td><b>Email:</b></td><td>'+req.body.email+'</td></tr><tr style="background-color: #eee;"><td><b>Phone:</b></td><td>'+req.body.phone+'</td></tr><tr><td><b>emergency:</b></td><td>'+req.body.emergency+' </td></tr><tr style="background-color: #eee;"><td><b>phonecall:</b></td><td>'+ req.body.phonecall +' </td> </tr><tr><td><b>systemtype:</b></td><td>'+req.body.systemtype +'</td></tr><tr style="background-color: #eee;"><td><b>attachment:</b></td><td>'+req.body.attachment +' </td></tr><tr><td><b>supportrequest:</b></td><td>'+ req.body.supportrequest +' </td></tr></table>'// html body }; // send mail with defined transport object transporter.sendMail(mailOptions, function(error, info){ if(error){ return console.log(error); } console.log('Message sent: ' + info.response); }); }) var server = app.listen(8081, function () { var host = server.address().address var port = server.address().port })
  7. Hi, I have a details screen where visitors to the website can leave their contact info. I have some javascript rules to validate some of the fields when the visitor is filling them out so they cannot leave certain fields empty. I have an email field where aswell as stopping the visitor leaving the field blank i want a validation check so it looks for the presence of "@" and a "." within the field. But I am having trouble getting this implemented. Currently my code for the blank checks looks like this (with the email field in the last block) :- </script><script language="javascript" type="text/javascript">function validate_form ( ){valid = true; if (document.networkOpportunity.contactName.value == "") { alert ( "Please enter the name of the contact for the opportunity." ); document.networkOpportunity.contactName.focus(); document.networkOpportunity.contactName.style.backgroundColor = "#d7edf8"; valid = false; } else if (document.networkOpportunity.companyName.value == "") { alert ( "Please enter the company name that the opportunity is for." ); document.networkOpportunity.contactName.style.backgroundColor = "#FFFFFF"; document.networkOpportunity.companyName.focus(); document.networkOpportunity.companyName.style.backgroundColor = "#d7edf8"; valid = false; } else if (document.networkOpportunity.serviceRequired.value == "") { alert ( "Please enter the details of the service you require." ); document.networkOpportunity.companyName.style.backgroundColor = "#FFFFFF"; document.networkOpportunity.serviceRequired.focus(); document.networkOpportunity.serviceRequired.style.backgroundColor = "#d7edf8"; valid = false; } else if (document.networkOpportunity.contactEmail.value == "") { alert ( "Please enter the email we can contact you on." ); document.networkOpportunity.serviceRequired.style.backgroundColor = "#FFFFFF"; document.networkOpportunity.contactEmail.focus(); document.networkOpportunity.contactEmail.style.backgroundColor = "#d7edf8"; valid = false; } Any help with how to add the extra validation on the contactEmail field to look for "@" and "." will be greatly appreciated.
  8. Hello, I need to be able to send a form to a real email address using mail(), however every solution I find has to do with uploading the website to a host, and due to the nature of my project that's not possible. It must run in my own computer and still be capable of sending emails. Any example, code or help appreciated. Thanks
  9. Hello, Im a bit lost with this project, I cant seem to find the problem and I sure could use an extra set of eyes to look it over. when the form is submitted it comes back to the error page and the emails are not sent. any ideas? Thanks in advance! <?phpfunction ValidateEmail($email){ $pattern = '/^([0-9a-z]([-.w]*[0-9a-z])*@(([0-9a-z])+([-w]*[0-9a-z])*.)+[a-z]{2,6})$/i'; return preg_match($pattern, $email);}if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['formid'] == 'form344'){ $mailto = $_POST['unit'];if(isset($_POST['unit'])) { $units['M17'][] = 'email@email.com, email@email.com'; $units['M16'][] = 'email@email.com'; $to = implode(",",$units[$_POST['unit']]); $mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto; $subject = 'Transfer'; $message = ''; $success_url = './success.php'; $error_url = './error.php'; $error = ''; $eol = "n"; $max_filesize = isset($_POST['filesize']) ? $_POST['filesize'] * 1024 : 1024000; $boundary = md5(uniqid(time())); $header = 'From: '.$mailfrom.$eol; $header .= 'Reply-To: '.$mailfrom.$eol; $header .= 'MIME-Version: 1.0'.$eol; $header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol; $header .= 'X-Mailer: PHP v'.phpversion().$eol; if (!ValidateEmail($mailfrom)) { $error .= "The specified email address is invalid!n<br>"; } if (!empty($error)) { $errorcode = file_get_contents($error_url); $replace = "##error##"; $errorcode = str_replace($replace, $error, $errorcode); echo $errorcode; exit; } $internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field"); $message .= $eol; foreach ($_POST as $key => $value) { if (!in_array(strtolower($key), $internalfields)) { if (!is_array($value)) { $message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol; } else { $message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol; } } } $body = 'This is a multi-part message in MIME format.'.$eol.$eol; $body .= '--'.$boundary.$eol; $body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol; $body .= 'Content-Transfer-Encoding: 8bit'.$eol; $body .= $eol.stripslashes($message).$eol; if (!empty($_FILES)) { foreach ($_FILES as $key => $value) { if ($_FILES[$key]['error'] == 0 && $_FILES[$key]['size'] <= $max_filesize) { $body .= '--'.$boundary.$eol; $body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol; $body .= 'Content-Transfer-Encoding: base64'.$eol; $body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol; $body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol; } } } $body .= '--'.$boundary.'--'.$eol; if ($mailto != '') { mail($mailto, $subject, $body, $header); }mail($mailto, $subject, $body, $header); header('Location: '.$success_url); exit;}}if (session_id() == ""){ session_start();}if (!isset($_SESSION['username'])){ header('Location: ./notloggedin.php'); exit;}if (isset($_SESSION['expires_by'])){ $expires_by = intval($_SESSION['expires_by']); if (time() < $expires_by) { $_SESSION['expires_by'] = time() + intval($_SESSION['expires_timeout']); } else { unset($_SESSION['username']); unset($_SESSION['expires_by']); unset($_SESSION['expires_timeout']); header('Location: ./notloggedin.php'); exit; }}if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['formid'] == 'form1'){ $mailto = $_POST['unit'];if(isset($_POST['unit'])) { $units['M17'][] = 'email@email.com, email@email.com'; $units['M16'][] = 'email@email.com'; $to = implode(",",$units[$_POST['unit']]); $mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto; $subject = '911'; $message = ''; $success_url = './success.php'; $error_url = './error.php'; $error = ''; $eol = "n"; $max_filesize = isset($_POST['filesize']) ? $_POST['filesize'] * 1024 : 1024000; $boundary = md5(uniqid(time())); $header = 'From: '.$mailfrom.$eol; $header .= 'Reply-To: '.$mailfrom.$eol; $header .= 'MIME-Version: 1.0'.$eol; $header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol; $header .= 'X-Mailer: PHP v'.phpversion().$eol; if (!ValidateEmail($mailfrom)) { $error .= "The specified email address is invalid!n<br>"; } if (!empty($error)) { $errorcode = file_get_contents($error_url); $replace = "##error##"; $errorcode = str_replace($replace, $error, $errorcode); echo $errorcode; exit; } $internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field"); $message .= $eol; foreach ($_POST as $key => $value) { if (!in_array(strtolower($key), $internalfields)) { if (!is_array($value)) { $message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol; } else { $message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol; } } } $body = 'This is a multi-part message in MIME format.'.$eol.$eol; $body .= '--'.$boundary.$eol; $body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol; $body .= 'Content-Transfer-Encoding: 8bit'.$eol; $body .= $eol.stripslashes($message).$eol; if (!empty($_FILES)) { foreach ($_FILES as $key => $value) { if ($_FILES[$key]['error'] == 0 && $_FILES[$key]['size'] <= $max_filesize) { $body .= '--'.$boundary.$eol; $body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol; $body .= 'Content-Transfer-Encoding: base64'.$eol; $body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol; $body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol; } } } $body .= '--'.$boundary.'--'.$eol;}}?>
  10. Hello, I created an order form on my website that takes the user's inputs, send confirmation emails to them and myself (order@), and then inserts the order into a mySQL database. The emails used to work, but now, for some reason, they never get sent. The email address it is supposed to be sending it to works and I have validated that nothing is getting blocked in SPAM, etc. The code for the email portion is below. I have tried debugging myself, but I get no errors on the mail() portion of the code. Any help that could be offered would be greatly appreciated. Thank you. if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "order@idrinktoremember.com"; $email_subject = "We've Got an Order!"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['first_name']) || !isset($_POST['last_name']) || !isset($_POST['email']) || !isset($_POST['telephone']) || !isset($_POST['address']) || !isset($_POST['city']) || !isset($_POST['state']) || !isset($_POST['zip']) || !isset($_POST['opener']) || !isset($_POST['stain']) || !isset($_POST['memory']) || !isset($_POST['catcher'])) { died('We are sorry, but please ensure you filled in all required items. Click back to check.'); } $first_name = $_POST['first_name']; // required $last_name = $_POST['last_name']; // required $email_from = $_POST['email']; // required $telephone = $_POST['telephone']; // required $address = $_POST['address']; // required $city = $_POST['city']; // required $state = $_POST['state']; // required $zip = $_POST['zip']; // required $opener = $_POST['opener']; // required $stain = $_POST['stain']; // required $memory = $_POST['memory']; // required $catcher = $_POST['catcher']; // required $comments = $_POST['comments']; // not required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$first_name)) { $error_message .= 'The First Name you entered does not appear to be valid.<br />'; } if(!preg_match($string_exp,$last_name)) { $error_message .= 'The Last Name you entered does not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Order details below.nn"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "First Name: ".clean_string($first_name)."n"; $email_message .= "Last Name: ".clean_string($last_name)."n"; $email_message .= "Email: ".clean_string($email_from)."n"; $email_message .= "Telephone: ".clean_string($telephone)."n";$email_message .= "Address: ".clean_string($address)."n";$email_message .= "City: ".clean_string($city)."n";$email_message .= "State: ".clean_string($state)."n";$email_message .= "Zip Code: ".clean_string($zip)."n";$email_message .= "Opener: ".clean_string($opener)."n";$email_message .= "Stain Selected: ".clean_string($stain)."n";$email_message .= "Memory Requested: ".clean_string($memory)."n";$email_message .= "Catcher Requested: ".clean_string($catcher)."n";$email_message .= "Comments: ".clean_string($comments)."n"; //create email headers $email_us = "order@idrinktoremember.com";$headers = "From: $email_us rn";$headers .= "Reply-To: $email_us rn";$headers .= "Return-Path: $email_usrn";$headers .= "X-Mailer: PHP rn";if(mail($email_to, $email_subject, $email_message, $headers)){ echo '';}else{ echo 'Error';}//send order confirmation email$email_subject_confirmation = "Congratulations, your order has been submitted!";$email_message_confirmation .= "The details of your order are below. Please review.nn";$email_message_confirmation .= "First Name: ".clean_string($first_name)."n"; $email_message_confirmation .= "Last Name: ".clean_string($last_name)."n"; $email_message_confirmation .= "Email: ".clean_string($email_from)."n"; $email_message_confirmation .= "Telephone: ".clean_string($telephone)."n";$email_message_confirmation .= "Address: ".clean_string($address)."n";$email_message_confirmation .= "City: ".clean_string($city)."n";$email_message_confirmation .= "State: ".clean_string($state)."n";$email_message_confirmation .= "Zip Code: ".clean_string($zip)."n";$email_message_confirmation .= "Opener Selected: ".clean_string($opener)."n";$email_message_confirmation .= "Stain Selected: ".clean_string($stain)."n";$email_message_confirmation .= "Memory Requested: ".clean_string($memory)."n";$email_message_confirmation .= "Catcher Requested: ".clean_string($catcher)."n";$email_message_confirmation .= "Comments: ".clean_string($comments)."n";$email_message_confirmation .= "nnWe will be contacting you shortly with a prototype of your design!n";$email_message_confirmation .= "nThe MemoraBEERLia Team";$headers = "From: $email_us rn";$headers .= "Reply-To: $email_us rn";$headers .= "Return-Path: $email_usrn";$headers .= "X-Mailer: PHP rn";if(mail($email_from, $email_subject_confirmation, $email_message_confirmation, $headers)){ echo '';}else{ echo 'Error';}
  11. Hi, Just wanted to ask people's opinions around responsive email templates and compatibility in most versions of outlook. I've been yet to find a responsive template that will still work well in versions of outlook and was wondering if anyone can shed light on the subject as to whether there are any templates/methods that still display well with older email clients? Thanks Ben
  12. Salam or Hello @ All, It's me Bilal since a very long ago, today I'm posting this topic because I'm dive into a problem which is: I want to send a email after collecting data from html form which is pretty simple with the help of PHP but can the same functionality can be performed by using just JavaScript only? if so please discuss the possibilities on this topic. Don't be tell about the mailto function of the html because it is not good at all. I'm waiting for your pretty responses......
  13. Hi good people of w3, I'd been using the tutorials on this site a lot in an attempt to get the email enquiry form working for the website I've been putting together for the place I'm currently employed at. This isn't exactly my forte, I'm pretty decent when it comes to html but php is an animal I'm only just starting to become familiar with.I have an issue currently where particular parts of the form are required to be filled in, and I can successfully generate errors when this does not occur. However, the errors do not actually stop the email from being sent and hence we end up with incomplete enquiries on the other side when the form is not correctly filled in.If anyone could provide some advice as to a means to make the errors stop the email from being sent, that would be much appreciated. The relevant code is below. <?php// define variables and set to empty values$nameErr = $emailErr = $partErr = $phoneErr = "";$name = $email = $part = $comments = $model = $brand = $phone = $contact_method = $product = $breakdown = "";if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) { $nameErr = "Name is required"; } else { $name = test_input($_POST["name"]); // check if name only contains letters and whitespace if (!preg_match("/^[a-zA-Z ]*$/",$name)) { $nameErr = "Only letters and white space allowed"; } } if (empty($_POST["email"])) { $emailErr = "Email is required"; } else { $email = test_input($_POST["email"]); // check if e-mail address is well-formed if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $emailErr = "Invalid email format"; } } if (empty($_POST["phone"])) { $contact_methodErr = "Phone number is required"; } else { $phone = test_input($_POST["phone"]); } $contact_method = test_input($_POST["contact_method"]); $brand = test_input($_POST["brand"]); $product = test_input($_POST["product"]); $model = test_input($_POST["model"]); $breakdown = test_input($_POST["breakdown"]); if (empty($_POST["part"])) { $partErr = "Part number or description is required"; } else { $part = test_input($_POST["part"]); } $comments = test_input($_POST["comments"]); } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data;}// Function to validate against any email injection attemptsfunction IsInjected($str){ $injections = array('(n+)', '(r+)', '(t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; }} //Validate firstif(IsInjected($customer_email)){ echo "Bad email value!"; exit;} $email_from = 'sales@speedyspares.com';//<== update the email address $email_subject = "Online Enquiry"; $email_body = '<html><body>'; $email_body .= '<table rules="all" style="border-color: #666;" cellpadding="10">'; $email_body .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" . $name = $_POST["name"] . "</td></tr>"; $email_body .= "<tr><td><strong>Email:</strong> </td><td>" . $email = $_POST["email"] . "</td></tr>"; $email_body .= "<tr><td><strong>Phone:</strong> </td><td>" . $phone = $_POST["phone"] . "</td></tr>"; $email_body .= "<tr><td><strong>Preferred Method of Contact:</strong> </td><td>" . $contact_method = $_POST[ "contact_method"] . "</td></tr>"; $email_body .= "<tr><td><strong>Brand:</strong> </td><td>" . $brand = $_POST["brand"] . "</td></tr>"; $email_body .= "<tr><td><strong>Product:</strong> </td><td>" . $product = $_POST["product"] . "</td></tr>"; $email_body .= "<tr><td><strong>Model:</strong> </td><td>" . $model = $_POST["model"] . "</td></tr>"; $email_body .= "<tr><td><strong>Breakdown Required:</strong> </td><td>" . $breakdown = $_POST["breakdown"] . "</td></tr>"; $email_body .= "<tr><td><strong>Part:</strong> </td><td>" . $part = $_POST["part"] . "</td></tr>"; $email_body .= "<tr><td><strong>Comments:</strong> </td><td>" . $comments = $_POST["comments"] . "</td></tr>"; $email_body .= "</table>"; $email_body .= "</body></html>"; $to = "sales@speedyspares.com";//<== update the email address $headers = "From: $email_from rn"; $headers .= "Reply-To: $email rn"; $headers .= "MIME-Version: 1.0rn"; $headers .= "Content-Type: text/htmlrn"; //Send the email! mail($to,$email_subject,$email_body,$headers); //done. redirect to thank-you page. header('Location: thankyou.html'); ?><form method="post" name="enquiry-form" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <h6><strong><span class="redasterisk">*</span></strong>denotes a required field</h6> <h6>Name:<span class="error">* <?php echo $nameErr;?></span><br> <input name="name" type="text" size="50"> <br> E-mail:<span class="error">* <?php echo $emailErr;?></span><br> <input name="email" type="text" size="50"> <br> Phone:<span class="error">* <?php echo $phoneErr;?></span><br> <input name="phone" type="text" size="50"> <br /> Preferred Contact Method:<br /> <input type="radio" name="contact" value="email" /> Email <input type="radio" name="contact" value="phone" /> Phone <br /> Brand:<br> <select name="brand"> <option value="Sony">SONY</option> <option value="Sharp">SHARP</option> <option value="Hills">HILLS</option> <option value="Other">OTHER</option> </select><br /> Product:<br> <select name="product"> <option value="TV">TV/PROJECTOR</option> <option value="VIDEO">HOME VIDEO/DVD/BLU-RAY</option> <option value="AUDIO">HOME AUDIO/THEATRE SYSTEM</option> <option value="CAMERA">DIGITAL STILL CAMERA</option> <option value="CAMCORDER">VIDEO CAMERA/CAMCORDER</option> <option value="VAIO">PERSONAL COMPUTER (VAIO)</option> <option value="EREADER">eBOOK READER</option> <option value="PAUDIO">PERSONAL AUDIO</option> <option value="CAUDIO">CAR AUDIO</option> <option value="FRIDGE">REFRIDGERATOR</option> <option value="MICROWAVE">MICROWAVE</option> <option value="OTHER">OTHER</option> </select><br /> Model :<br /><em>(eg. KDL-46HX800)</em><br> <input type="text" name="model" size="50"> <br /> <input type="checkbox" name="breakdown" value="Yes" /> Request Breakdown<br /> Part number/description:<span class="error">* <?php echo $partErr;?></span><br /><em>(e.g. UWA-BR100 Wi-fi Adaptor)</em><br /> <input type="text" name="part" size="50"> <br> Comments:<br> <textarea name="comments" cols="50" rows="5">Please supply any additional information that may assist with your enquiry. (color/size/location etc.)</textarea> <br /> (Please do not use this form for submission of credit card information)</h6> <h5> <input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"> </h5> </form>
  14. Hello internet, I tried asking this question once already but there were no responses. Does this mean my question is not written well - or there are no suggestions... Here is my question... The issue of the day is this… I have a successful form that submits user information to my database through a php file. Using chrome it will send the user information to the database but will not kick out an email. This is strange. IE/Safari work just fine – but Chrome will not work. What small nuance am I missing?
  15. Before I put encrypted JS code into my website, can anyone tell me if this source is trustworthy? What I mean is, does Webtools hide something nasty into the encryption in addition to what I type into the window? I want to keep my email address safe from robots. That is, I want to encrypt <a href="mailto:MYemail@MYdomain.com">...</a> I've created a dummy email address and tested it. It seems to work fine, but I don't want it if they sell the address to a spammer. I looking for protection from email skimmers, not ultimate security. I doubt someone would sift the rare JS encrypted websites for one email address. ( ...or am I being naive?) Who out there has some knowledge about this? Thank you!
  16. Hello internet! The issue of the day is this… I have a successful form that submits user information to my database through a php file. Using chrome it will send the user information to the database but will not kick out an email. This is strange. IE/Safari work just fine – but Chrome will not work. What small nuance am I missing?
  17. Hello everbody I want to know if there is a possibility to invite friends by email to register on Facebook. for example if I create a Facebook account can i invite my friends via email to register on Facebook? of course my friends who do not yet have a Facebook account. that is to say, these companies (Hotmail, Gmail and Yahoo) offer this service or not (allow us to import emails from their servers). if yes, these services are free or paid? and thank you in advance for your response
  18. so, what i am trying to do is send an email from an HTML FORM. i want to keep it somewhat simple, meaning i don't want employ JS or PHP. HTML and CSS only. what i have so far: <form name="DriveOnRequest" method="POST" action="mailto:myemail@example.com?subject=Drive On Request" type="text/html" content-type="Multipart/formdata" accept-charset="UTF-8" enctype="Multipart/formdata" > <table> <td> <tr> <th><label>Requestor Name:<abbr title="Enter your name if you are the requestor or the name of the person who you are requesting the drive on for.">Help</abbr></label></th> <td><label>First</label><input type="text" name="first1" min="2" required></td> <td><label>Last</label><input type="text" name="last1" min="2" required></td> </tr> this is the more important part .. i think as i believe that the problem is somewhere in here. i am closing the form out and have a submit button. everything works fine up until then. when i submit it opens the default email program and is ready to send; however, the email inside looks something like this: Questions: 1. How can i remove the INPUT NAME Tags (first1=) or at least the "=" sign? 2. How can i remove the "&" sign obviously used as space. 3. Is there a way to style the whole thing at all? Because this is really where i need it. In the email, not the form. I am thinking that it has to do with the charset or the encoding but i am not sure. I find everything on the www about how to style the form but no more than bits and pieces about the resulting email.
  19. Good Morning everyone, When i set my html signature in my mail client (i tried mac mail & Outlook 2003) the compleet mail aligns to the left. not even 1px is spared. Also check the .png i attached to see what i mean. Besides that i attached the html document i've made. I just need some spacing on the left of my mail, and the top also actually. I really hope u guys can help me out here! Thanks in advance. Cheers, RuudBergen Email signature Ruud_4.html
  20. So I'm trying to build out an html email for a client in Constant Contact. I've worked out most every bug in all email clients, but for some reason one of my tables (see code comment "table two - left & right columns") is being shifted to the left by about 1px. It doesn't do this in Apple's mail client, nor does it display like that when viewed in a browser. It seems to only occur in Microsoft and Google email clients. The math on the tables adds up, the images are correct, all padding, margins, spacing, borders, etc. are removed. I'm at a loss and on deadline. Any help would be awesome. Here's the code: <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:cctd="http://www.constantcontact.com/cctd"><body><CopyRight>Copyright (c) 1996-2013 Constant Contact. All rights reserved. Except as permitted under a separatewritten agreement with Constant Contact, neither the Constant Contact software, nor any content that appears on any Constant Contact site,including but not limited to, web pages, newsletters, or templates may be reproduced, republished, repurposed, or distributed without theprior written permission of Constant Contact. For inquiries regarding reproduction or distribution of any Constant Contact material, pleasecontact legal@constantcontact.com.</CopyRight><OpenTracking/><!-- Do NOT delete previous line if you want to get statistics on the number of opened emails --><CustomBlock name="letter.intro" title="Personalization"> <Greeting/></CustomBlock><table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td bgcolor="#FFFFFF"><!-- HEADER --> <table width="630" cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="#FFFFFF"> <tbody> <tr> <td valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/1.jpg?ver=1384527780000" /></a> </td> </tr> </tbody> </table><!-- TABLE ONE - MAIN PHOTO --> <table width="630" cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="#FFFFFF"> <tbody> <tr> <td valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/2.jpg?ver=1384527781000?ver=1384527781000" /></a> </td> </tr> </tbody> </table><!-- TABLE TWO - LEFT & RIGHT COLUMNS --> <table width="630" cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="#FFFFFF"> <tbody> <tr> <td valign="top"><!-- TABLE TWO - LEFT COLUMN --> <table width="222" cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="#FFFFFF"> <tbody> <tr> <td colspan="3" valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/3.jpg?ver=1384527781000?ver=1384527781000?ver=1384527781000" /></a> </td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/6.jpg?ver=1384527783000?ver=1384527783000?ver=1384527783000?ver=1384527783000" /></a> </td> </tr><!-- TABLE TWO - LEFT COLUMN - SOCIAL MEDIA --> <tr> <td valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/8.jpg?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000" /></a> </td> <td valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/9.jpg?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000" /></a> </td> <td valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/10.jpg?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000" /></a> </td> </tr> </tbody> </table> </td> <td valign="top"><!-- TABLE TWO - RIGHT COLUMN --> <table width="408" cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="#FFFFFF"> <tr> <td valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/4.jpg?ver=1384527782000?ver=1384527782000?ver=1384527782000?ver=1384527782000?ver=1384527782000?ver=1384527782000?ver=1384527782000?ver=1384527782000?ver=1384527782000?ver=1384527782000?ver=1384527782000" /></a> </td> </tr> <tr> <td valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/5.jpg?ver=1384527783000?ver=1384527783000?ver=1384527783000?ver=1384527783000?ver=1384527783000?ver=1384527783000?ver=1384527783000?ver=1384527783000?ver=1384527783000?ver=1384527783000?ver=1384527783000?ver=1384527783000" /></a> </td> </tr> <tr> <td valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/7.jpg?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000?ver=1384527784000" /></a> </td> </tr> </table> </td> </tr> </tbody> </table><!-- TABLE THREE --> <table width="630" cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="#FFFFFF"> <tbody> <tr> <td valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/11.jpg?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000" /></a> </td> </tr> </tbody> </table><!-- FOOTER --> <table cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="#FFFFFF"> <tbody> <tr> <td valign="top" bgcolor="#FFFFFF"> <a href=""><img style="display:block; margin: 0; padding: 0;" src="https://origin.ih.constantcontact.com/fs114/1115667751850/img/12.jpg?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000?ver=1384527785000" /></a> </td> </tr> </tbody> </table> </td> </tr> </tbody></table></body></html>
  21. I'm having trouble sending emails from an email like "mail@domain.com" wich is configured to use the live.mail.com client. Even though i think i'm using the right credentials i get the following error: "Mailbox unavailable. The server response was: 5.7.3 Requested action aborted; user not authenticated" this are my configurations: smtpClient = new SmtpClient("smtp.live.com");smtpClient.Port = 587;smtpClient.UseDefaultCredentials = false;smtpClient.Credentials = new System.Net.NetworkCredential("mail@domain.com", "Password");smtpClient.EnableSsl = true; any help is appreciated, for I can't seem to work-arround this problem and have to have this website online ASAP
  22. hi all, i am back i need to send mass emails to hundreds of members at the same time using a cron job.i have this script... $sql = mysql_query("SELECT * FROM members WHERE emailactivated = '0'");while($row = mysql_fetch_array($sql)){$email_add = $row["email"];$to = "$email_add";$from = "admin@mysite.com";$subject = "sign up";$message = '<html><body bgcolor="#FFFFFF">hello</body></html>';$headers = "From: $from\r\n";$headers .= "Content-type: text/html\r\n";mail($to, $subject, $message, $headers);} will this work?
  23. I'm not the greatest at doing HTML codes but have learnt a lot since starting. This leads me on to the problem I'm having. At work we use HTML templates to make up our header and footer and recently I was asked to sort something out so when stuff reply or forward email there's a footer. I thought this was easy enough and adapted the HTML files we already have and used them as a template, all looked good and the job was finished. Now after they've been used a few times it seems that from time to time the reply templet will ignore its setting and go off the original email meaning fonts will change, the size of the writing changes, colours and so on. What I'm hoping someone can help me with is ever advising a way to get the footer to follow its owe setting instead of the original email or to tell me this can't be done. Any help is greatly appreciated and sorry if I didn't use the right terms anywhere. Jordan
  24. hello all, In my application I want to verify users email ID. So that I want to send a verification code to their email.Kindly anybody help regarding this. I want to send email from my application using a gmail account. Thank you
  25. Hi, I am having problems with a script I am recycling from my client's old site. The issue was there before but wondering if there is a way to fix it. The page is here: http://www.tech-one-biomedical-services--inc.mybigcommerce.com/contact/ The email links don't work now that there is a class assigned to the table, enabling the backgrounds to be highlighted when the parts of the map are clicked on. They didn't work before either but I didn't realize it until the client pointed it out. I see when I hover in Firefox it looks like it should work, see the mailto: ref coming up, but when you click...nothing. Is there any way to either get the same effect with the clicking (or even hovering would be fine) so that the email links inside work? I tried embedding a table in this but it didn't work either. The original scrip is at: http://www.techonebiomedical.com/contact.html I am java illiterate so have no idea on the insides. Thanks!Gina