php - HTML to send a pre-written email -
I have placed a website on the Internet, and I have a function where a user can enter his email address Form and when deposited, they will receive a pre-set email.
There are other questions, but none of these help me.
I have basic code here:
& lt; Form action = "send.php" method = "post" & gt; & Lt; Input type = "text" name = "mail" & gt; & Lt; Input type = "submit" value = "send" & gt; & Lt; / Form & gt;
Here is send.php
Please seduce this fact that you have to send it twice, I will change it.
What I have to do, send to the user (email $ mail
) via email is a pre-written document, not the form of an attachment but the email is composed.
I am unsure as to the weather. I can only use one word document or complex code behind it.
Since I am only familiar with basic visual elements, can you please tell me what parts of code do, as I want to tweak it.
Thank you! As Fred said, the best way to reach this is when send.php runs,
Then you
mail ($ Mail, "My Email Subject", "<"> HTML ", $ headers);
Where your header variable should contain all the necessary information to tell your client's mail software, which contains the HTML in the string message that should be parsed, for example the header setup is as follows , With this problem:
$ headers = "to:". Strip_tag ($ _ POST ['Rick-email']) "\ r \ n"; $ Headers = "Reply:" Strip_tag ($ _ POST ['Rick-email']) "\ r \ n"; $ Headers = "Cc: susan@example.com \ r \ n"; $ Headers = "Mime-version: 1.0 \ r \ n"; $ Headers = "Content-type: text / html; charset = ISO-885 9-1 \ r \ n";
Note that you can change the strip_tags
call to the email you want. Then, you can see my & lt; Html & gt; & Lt; B & gt; Email message & lt; / B & gt; & Lt; / Html & gt; You can change
with any code, which you want to be well-formatted email.
Similar to PHP using the mail ()
function, so you do not need to submit it twice
Comments
Post a Comment