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
How do I know when getBounds Method is ready to be called.
I have an application that changes out stylesheets client side. Once I change stylesheet the browse
Oracle Text CTX_DOC.snippet slow
I have a table (FILE_TABLE) that contains a blob column (ft_file) and I have created the following O
check how many commas the variable containing the query has between [i]select[/i
Hi...
iv made an sql table that contains id number - name of sql query and an sql query.
T
Forum tutorial
Im a beginner in PHP. Im making a forum(previous questbook, counter and few others) to learn. For no
records between 2 dates
Hello all,
I have a date tracked table which contains effective_start_date and effective
Database/Table Collation
What is the Database, and table collations used for? i don't understand what there used for since co
CHMOD script
Hi,
I need a script to read all files in a folder and set to 777.
Can anyone help out
PHP Tab Control
Hi All,
I would like to have PHP tab control with/without Javascript.
But I want to r
Quick Syntax Question
Hi folks,
I'm getting the following error: "unexpected T_LNUMBER". I'm trying to b
FAGL_FC_TRANSLATION FAS52 New GL ECC 6.0
Hello,
The new program for Translating GL Balances (FAS 52) gives the option to use diffe