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
form variables from database help.
Hi all,
I would like to have a form that gives you options based on the results of an mysql q
Easy administration on MySQL databases
My website is database driven and I am very tired of manually making queries to my tables in order t
Uploading files/images via forms
Hey all, I am building a database for work that will contain some minor data on plant species along
Word Trimming
Hi Guys & Gals!!
Hope you are all ok....
I need some help with the following
Got A Free Server :(
So I was given a free server
http://shopping.yahoo.com/p:Compaq%20ProLiant%201500%20Server:1
C++ API to Oracle dB
I need to perform a select command to the Oracle dB to obtain information from a table.
What libr
PHP & MS Access - Line Break
Hey Guys!
I'm pulling records from an MS Access database and listing them using PHP and I'm r
Taking an HTML form and a PHP program and making it into one working file.
Hello,
So I would like to display everything INSIDE a specific directory. In other words, I
Rand() help needed
Hi all,
Can someone explain and give me a quick example of how I would go about this?
Need help/w Page: 1,2,3,4 function!
So I have this code im working on where it's ment to display seperate pages having 20 logs each
I