| | |
form to mail problem
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2009
Posts: 3
Reputation:
Solved Threads: 0
Hi! here is my problem . I'm a psychology student and i'm trying to do a survey on my friends from my YM list . I want to send them forms in their inbox and they will answer back .
My form looks like this :
My feedback.php looks like this :
Bassically , i'm trying to write a simple code , just something to help me in my study . The purpose of the study is to send this form by email , not post it on a web page (and i want to learn some html). So far , i've managed to make it work , by testing it in a browser .But when i try to test it in an email client , the result from my .php comes back empty . I have observed that , the mail client changes my html code , and removes the " " , and the code of my form looks like this after being introduced in a mail client :
How can i stop the mail client from changing my code ? Or how can i improve my code to make this work ?
My form looks like this :
html Syntax (Toggle Plain Text)
<form method="post" action="http://mysite.com/feedback.php"> Question1 <input name="question1" type="text" /><br /> Question2 <input name="question2" type="text" /><br /> <input type="submit" /> </form>
My feedback.php looks like this :
php Syntax (Toggle Plain Text)
<?php $Question1 = $_REQUEST['Question1'] ; $Question2 = $_REQUEST['Question2'] ; mail( "mymail@gmail.com", "Feedback Form Results", $Question1, $Question2 ); header( "Location: http://www.mysite.com/thankyou.html" ); ?>
Bassically , i'm trying to write a simple code , just something to help me in my study . The purpose of the study is to send this form by email , not post it on a web page (and i want to learn some html). So far , i've managed to make it work , by testing it in a browser .But when i try to test it in an email client , the result from my .php comes back empty . I have observed that , the mail client changes my html code , and removes the " " , and the code of my form looks like this after being introduced in a mail client :
html Syntax (Toggle Plain Text)
<FORM action=http://mysite.com/feedback.php method=post>Question1 <INPUT name=question1><BR>Question2 <INPUT name=question2><BR><INPUT type=submit value="Submit Query"> </FORM>
How can i stop the mail client from changing my code ? Or how can i improve my code to make this work ?
Last edited by peter_budo; Mar 26th, 2009 at 11:30 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
I've always found that email clients remove quotes from attribute values and some, like hotmail, actually change the values. The only solution that I've found is to not surround values in quotes. Clients have so many techniques to weed out spam and malicious messages, html emails can be tricky.
Also, the php mail function will work fine with a contact form on your site that submits to an address on your server MX. But if you try to send the mail to a major mail server like hotmail or gmail account, it's probably going to wind up in the junk folder (at best). The mail function lacks SMTP authentication and thus most clients are going to flip it the bird. If your serious about html email, you should start with a class that includes SMTP, like phpmailer.
As for forms in an email, I doubt that will fly with many email clients. Keep the form on the site and send a link to the form through email.
Also, the php mail function will work fine with a contact form on your site that submits to an address on your server MX. But if you try to send the mail to a major mail server like hotmail or gmail account, it's probably going to wind up in the junk folder (at best). The mail function lacks SMTP authentication and thus most clients are going to flip it the bird. If your serious about html email, you should start with a class that includes SMTP, like phpmailer.
As for forms in an email, I doubt that will fly with many email clients. Keep the form on the site and send a link to the form through email.
Last edited by buddylee17; Mar 26th, 2009 at 10:19 am.
Lost time is never found again.
- Benjamin Franklin
- Benjamin Franklin
•
•
Join Date: Mar 2009
Posts: 3
Reputation:
Solved Threads: 0
Thank you for your answer. I also have a link to my website form . The pupose of my study is trust . Are they willing to submit a form by email , or within a web page , or not at all , and why would they choose an option or onother . Is a matter of trust , the entire email will contain some confusing data about the sender and the purpose . The only mail client that will receive my mail form will be yahoo , i have enough friends there to conduct the study .
![]() |
Similar Threads
- PHP Form mail and hebrew (PHP)
- Learning PHP but problem with script (PHP)
- Hotmail ONLY accessing page problem -- Only with one account (Web Browsers)
- form to mail - Hebrew problem (PHP)
- asp form problem (ASP)
Other Threads in the PHP Forum
- Previous Thread: How to use browser as a remote window?
- Next Thread: Using a variable in fetch_array?
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube





