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
displaying email without attracting a ton of spam
Hello,
this is maybe the wrong place to ask.
How would you display an email address on a w
OPINIONS WANTED
This is my login page code, and I want your opinion on it please!
Code: // Login ~ CHECKS
C - Reading a file into a byte array
Hi,
I'm trying to read a file into a byte array in C. I have to use C as this is for a loadru
update sql when refresh - php
hi
I have made a table (attachement)
the users can update the sql database using + or x bu
Add weeks in a query?
I have a SQL that summarizes the quantity per week. The weeks that has no value does not exist in th
How can i steam a video on my PHP site? (non YouTube)
Basically I have a PHP site and don't want to give page rank to YouTube. I just want to stream a bas
Open browser page depending on XML results
Hello,
I have some PHP code that sends webbased from data to an external url ( in the form of
Why use interfaces in PHP (OOP)
I am learning OOP in PHP and its been a pretty good learning experience so far. What I didn't unders
Hyperlink in PHP to MySQL record
Hello,
I am having trouble as i am new to php. I have connected to the database and I have di
COde for a Cc
I'm not receiving $ft as a Cc. Why is that??
$to = "$email";
$headers = "Fr