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
Tournament Brackets (Double Elimination)?
Is making a double elimination tournament style bracket system capable of being done in php?
Taylor Series Function
So I am working a a project for my intro C++ class, and I am having some trouble with a function for
Show specific day of the week
I have been racking my brain trying to get this function to work properly and it is doing so for eve
Default TimeZone
The server I'm working with is hosted in America so all times inserted into the database are coming
Update not working ... please help
Hi,
I am trying to update a row using an edit form by passing id of the row .. but it is not
How to add advertisment on top of videos
Hello,
I was told that i should find the answer for this problem in this forums.
I searched a
natcasesort works on one server but not on another
Hi
I have a problem that I was hoping that someone can help me with.
I'm trying to use
Problem with array max size.
Hi to everyone,
I've got a homework about filling a bidimensional array un spiral shape, I alre
Help with PHP Calendar code...
Hello, I'm new to this forum and I'm glad I found it.
I wrote this code for a PHP calendar as an
mySQL and PHP search
Hello,
I am trying to code a project and ran into a brick wall with one of my pages. I am pretty