- This topic is empty.
-
AuthorPosts
-
June 7, 2011 at 5:18 pm #33031tannercampbellParticipant
I rarely use forms, when I do I use a service like jotform.com or something similar. In this instance, since it is for my own site, I would like to NOT have to do that.
here’s what my form looks like:
and here’s php/sendmail.php
$email = $_REQUEST ;
mail( "[email protected]", "Flock Subscription", "From: $email" );
header( "Location: http://www.theaddresshere.com" );
?>definitely NOT a php guy whatsoever – could I get some help? And yes, “theaddresshere” is intentional, the real site isn’t ready for viewing.
June 7, 2011 at 6:43 pm #73964TT_MarkMemberDo you have a specific problem with the script or are you just looking for ways to make it more secure/advanced?
I mean…I can see things you can improve, like making sure you stripslashes() on the $_REQUEST (otherwise characters like ‘ can break the script.
But you have the To, Subject and Message written correctly. Is something not working as it should?
June 8, 2011 at 1:03 am #74009rkacenskiMemberYes, it would most likely be a server issue. Most hosting companies stager and limit the php mail() function to prevent server overload and crashes. There might not be a way to fix the delay but your syntax could use some improvement. Try something like this instead:
//First part of the email header, is the from address
$headers = "From: $email" . "rn";
//Second part to include HTML and make more legit to email services
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
$emailbody = "Body Content Here, and you can use ";
mail("[email protected]", "Flock Subscription", $emailbody, $headers);
Notice you were putting the “From: $email ” in the body part and left the headers null. The rest of the code should be pretty self-explanatory let me know if this helped.
June 8, 2011 at 12:05 pm #73851tannercampbellParticipantSo then:
$email = $_REQUEST;
$headers = "From: $email" . "rn";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
$emailbody = "$email has signed up for alerts from the Flock";
mail("[email protected]", "Flock Subscription", $emailbody, $headers);
?>
? I will see if this works and repost if I have another issue. Thanks, I appreciate you taking the time to help me out.
June 8, 2011 at 1:42 pm #73804rkacenskiMemberNo problem code looks good let me know how you make out.
June 8, 2011 at 1:46 pm #73806tannercampbellParticipantIt’s the strangest thing, I’m submitting to the form but not receiving it … I submitted at 12:26 it’s 1:45 … still nothing.
June 8, 2011 at 1:59 pm #73795rkacenskiMemberThen its most likely your web host. What web host do you have and what email service does email use (i.e. Google Apps).
June 8, 2011 at 2:17 pm #73797tannercampbellParticipantGoDaddy (dedicated) standard smtp
June 8, 2011 at 2:43 pm #73768rkacenskiMemberHmm ya I’ve have had problems in the past with their mail servers. Not much more I can help you with, I would suggest contacting support good luck.
June 8, 2011 at 4:12 pm #73758tannercampbellParticipantI’ve actually plugged my MailChimp’s form action into my html form action — seems to be doing the trick. Thanks @rkacenski!
June 8, 2011 at 5:57 pm #73711rkacenskiMemberOoo great I was gunna suggest MailChimp next, glad I could help.
June 16, 2011 at 10:24 am #72859chrisburtonParticipantI have had a delay issue ever since I started using my domain email with Gmail. Yesterday, I was trying to find a solution again on google and randomly came across a screencast from Chris.
Question: Are you using Gmail to receive email on your custom domain?
June 16, 2011 at 6:20 pm #72713chrisburtonParticipantI started importing mine on my regular gmail account and for whatever reason it would delay by sometimes over an hour. I stopped importing, signed up to google apps, went through the process including updating my MX records and it solved the issue completely.
Incase anyone else has this issue
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.