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
Using real time in php
I'm very average at PHP and im looking to introduce time to something on my site.
Its a sports si
Help with captcha script needed
Hello,
I am working on a script where reCAPTCHA or a similar form of CAPTCHA will be used, f
Need some ideas as to how to go about sorting this array...
Here's how the array's are created..
Code: <?php
while ($x = readdir($dp)) {
How can I Compare two xml documents?
Hi all,
I am doing a POC for my project and I am using XE database 10g version.
How to sum these output values
Hi
I need sum the month totals
SELECT region_name, area_name
,SUM (CASE WHEN S
Passing PHP variables from one page to another
Hello-
I'm having trouble figuring out how to transport a variable from one php file to anoth
Login Script Issues
I am using a script I got from http://phpsense.com/php/php-login-script.html in order to allow peopl
Php script to read msword file
hi,
I need to read a msword file and i want to print the contents in that word file.
i
Java API in PHP?
I have an application that we use internally here at the office.
The software company provide
Change Sort Order to Display Newest File First
Hi Guys,
I have a page that sorts the contents (PDFs) of a directory and displays them on the