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
SAP Project Module
I have seen in the SAP Project Module,plan cost and budget are not equal and even difference is sign
Error with login script
I am getting an error with my login script:
Error:
Code: Warning: Cannot modify header inf
Looping Problem
I've got a client that has a database with about 200 events at any given time. I'm trying to loop t
PHP Game
hy i was wondering what's the best method in order to make some automatic updates in a php game
<
Help? Need help on project with templates involving mysql and php.
I'm having a hard time explaining what I want but basically here is what I have in place:
-Da
Allowing ' and "
Hello everyone,
I am creating a form where users submit information to go into a database. I
Default TimeZone
The server I'm working with is hosted in America so all times inserted into the database are coming
pagination numbering pattern
Hello,
I have following code which works great for pagination. but i have small issue now.
smart reading from a text file
Hello there fellow coders, i was wondering if one of you wouldnt mind helping me with this problem i
my two tables
table1 : col1 = topicid , col2 = topic
table2 : col1 = sentid, col2 = sentence
Cod