Images in email problem
Posted on
16th Feb 2014 07:03 pm by
admin
I found this script for sending emails, it works but if the email has <img src="image.jpg"/> it will send this <img src="image.jpg"> < I tried to replace < > < with the right characters but it doesn't work. Any suggestions?
Code: <?php
/* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */
Did you know?Explore Trending and Topic pages for more stories like this.
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$slashes= stripslashes($message);
/* PHP form validation: the script checks that the Email field contains a valid email address and the Subject field isn't empty. preg_match performs a regular expression match. It's a very powerful PHP function to validate form fields and other strings - see PHP manual for details. */
if (!preg_match("/w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/", $email)) {
echo "<h4>Invalid email address</h4>";
echo "<a href='javascript:history.back(1);'>Back</a>";
} elseif ($subject == "") {
echo "<h4>No subject</h4>";
echo "<a href='javascript:history.back(1);'>Back</a>";
}
/* Sends the mail and outputs the "Thank you" string if the mail is successfully sent, or the error string otherwise. */
elseif (mail($email,$subject,$slashes)) {
echo "<h4>Thank you for sending email</h4>";
} else {
echo "<h4>Can't send email to $email</h4>";
}
?>
No comments posted yet
Your Answer:
Login to answer
232
13
Other forums
Select Lists into MYSQL
Hello All, I am new to PHP @ 1 week. So borrowing code anywhere I can. I am making progress, but h
Multiple WHILE loops help
Hi there. I'm writing an application that is pulling and displaying results for real estate listing
Multiple websites question.
Hi, does php have any functionality that enables a programmer to extract information from a website
Setting condidtions for an input box
Hi all,
I would like to set a condition in a txt box that says the number a user enters has t
Displaying a record from mysql in a simple swf file
Hi,
I have a mysql database containing information I would like to display in my swf.
How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor
Mail form doesn't send Russian/Cyrillic characters correctly?
When someone enters foreign characters (like Cyrillic text, and Japanese/Chinese probably gives the
Clean URLs
Hi I was wandering if anyone has ever implemented URLs on their PHP run website using URLS like wiki
dropdown box help - open php files to textarea
Hi, I am using tinymce to edit content located in several php files. The code I attached works but i
EU VAT Package 2010
Does any one know whether SAP will be developing new reporting functionality due the new VAT rules t