Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
347 views
in Technique[技术] by (71.8m points)

Creating a free mailer the HTML form does not post to the PHP code

I'm trying to create a free email sender but to no avail.

I Use the PHP script alone to send the Mail message containing the HTML template, it goes just smooth and delivers fine.

However when i try to send it using my website the HTML template doesn't arrive.

The following PHP snippet does not work in conjunction with the HTML code :

<?Php
$message = '<html><body>';
$message .= (isset($_POST['message']));
$message .= "</body></html>";
>

However without the HTML only PHP I manage to send.

$message = "<html><body>example</html></body>" 

I think that the problem is with my HTML form.

<br><b>Your Message:</b><br>
<textarea type="html" name="message" rows="5" cols="50"style="width: 100%;"></textarea>
<br>

I'm no expert in this, and any help would be greatly appreciated.

question from:https://stackoverflow.com/questions/65660978/creating-a-free-mailer-the-html-form-does-not-post-to-the-php-code

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The problem is the isset() in the second line:

$message = '<html><body>';
$message .= (isset($_POST['message']));
$message .= "</body></html>";

This will only put (TRUE) inside the Body ;-)

change it to:

$message = '<html><body>';
$message .= $_POST['message'];
$message .= "</body></html>";

Do all checks like if(empty()) before.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...