Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
Contact Form, problems with GMAIL
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Wickd" data-source="post: 401356" data-attributes="member: 26932"><p>Hey guys so i'll go straight to my problem.Anyway i set up a decent contact form that should send e-mails to my main gmail account but it doesnt.Some of the mails go through but they're either delayed or filtered as spam.I thought it was a problem regarding the form itself but i tested out on my yahoo mail and the mails go trough instantly ( around a few seconds ).Any ideas?</p><p></p><p>Also it's just the e-mails that come from my contact form; email-email work perfectly fine.</p><p>Doubt it's the code but Y NOT</p><p>[PHP]<?php</p><p></p><p>// define("WEBMASTER_EMAIL", '');</p><p>//$address = "";</p><p>$address = "";</p><p>if (!defined("PHP_EOL")) define("PHP_EOL", "\r\n");</p><p></p><p>$error = false;</p><p>$fields = array( 'name', 'email', 'subject', 'message' );</p><p></p><p>foreach ( $fields as $field ) {</p><p> if ( empty($_POST[$field]) || trim($_POST[$field]) == '' )</p><p> $error = true;</p><p>}</p><p></p><p>if ( !$error ) {</p><p></p><p> $name = stripslashes($_POST['name']);</p><p> $email = trim($_POST['email']);</p><p> $subject = stripslashes($_POST['subject']); </p><p> $message = stripslashes($_POST['message']);</p><p> </p><p> $e_subject = 'You\'ve been contacted by ' . $name . '.';</p><p></p><p> // Configuration option.</p><p> </p><p></p><p> $e_body = "You have been contacted by: $name" . PHP_EOL . PHP_EOL;</p><p> $e_reply = "E-mail: $email" . PHP_EOL . PHP_EOL;</p><p> $e_subject = "\r\nsubject: $subject"; </p><p> $e_content = "Message:\r\n$message" . PHP_EOL . PHP_EOL;</p><p></p><p> $msg = wordwrap( $e_body . $e_reply .$e_subject , 70 );</p><p></p><p> $headers = "From: $email" . PHP_EOL;</p><p> $headers .= "Reply-To: $email" . PHP_EOL;</p><p> $headers .= "MIME-Version: 1.0" . PHP_EOL;</p><p> $headers .= "Content-type: text/plain; charset=utf-8" . PHP_EOL;</p><p> $headers .= "Content-Transfer-Encoding: quoted-printable" . PHP_EOL;</p><p></p><p> if(mail($address, $e_subject, $msg, $headers)) {</p><p></p><p> // Email has sent successfully, echo a success page.</p><p></p><p> echo 'Success';</p><p></p><p> } else {</p><p></p><p> echo 'ERROR!';</p><p></p><p> }</p><p></p><p>}</p><p></p><p>?>[/PHP]</p></blockquote><p></p>
[QUOTE="Wickd, post: 401356, member: 26932"] Hey guys so i'll go straight to my problem.Anyway i set up a decent contact form that should send e-mails to my main gmail account but it doesnt.Some of the mails go through but they're either delayed or filtered as spam.I thought it was a problem regarding the form itself but i tested out on my yahoo mail and the mails go trough instantly ( around a few seconds ).Any ideas? Also it's just the e-mails that come from my contact form; email-email work perfectly fine. Doubt it's the code but Y NOT [PHP]<?php // define("WEBMASTER_EMAIL", ''); //$address = ""; $address = ""; if (!defined("PHP_EOL")) define("PHP_EOL", "\r\n"); $error = false; $fields = array( 'name', 'email', 'subject', 'message' ); foreach ( $fields as $field ) { if ( empty($_POST[$field]) || trim($_POST[$field]) == '' ) $error = true; } if ( !$error ) { $name = stripslashes($_POST['name']); $email = trim($_POST['email']); $subject = stripslashes($_POST['subject']); $message = stripslashes($_POST['message']); $e_subject = 'You\'ve been contacted by ' . $name . '.'; // Configuration option. $e_body = "You have been contacted by: $name" . PHP_EOL . PHP_EOL; $e_reply = "E-mail: $email" . PHP_EOL . PHP_EOL; $e_subject = "\r\nsubject: $subject"; $e_content = "Message:\r\n$message" . PHP_EOL . PHP_EOL; $msg = wordwrap( $e_body . $e_reply .$e_subject , 70 ); $headers = "From: $email" . PHP_EOL; $headers .= "Reply-To: $email" . PHP_EOL; $headers .= "MIME-Version: 1.0" . PHP_EOL; $headers .= "Content-type: text/plain; charset=utf-8" . PHP_EOL; $headers .= "Content-Transfer-Encoding: quoted-printable" . PHP_EOL; if(mail($address, $e_subject, $msg, $headers)) { // Email has sent successfully, echo a success page. echo 'Success'; } else { echo 'ERROR!'; } } ?>[/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Contact Form, problems with GMAIL
Top