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 &lt;img src="image.jpg"&gt; &lt; I tried to replace &lt; &gt; &lt; 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. */
$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 Like 13 Dislike
Previous forums Next forums
Other forums

difference between datetimes
($row['totime']-$row['fromtime'])/60

this is giving me 0

example of totime and fromtim

Tree Menu
Hi guys,

Can anyone help me making a tree navigation system? I have a site where I'm allowin

Why doesn't this work? (SSH2)
This is my script:

Code: <?php
$connection = ssh2_connect('213.251.167.109', 22);

Fetching META TAGS through
Hello everybody
I want to fetch meta tags of a domain.
It will be done from following code of

a dificult string search
Hi I don't know a way around this. I want the user to input a password, but to make it a bit complca

Multiple arrays inside data
Hi,

Simple question. I have a column called "array" in my database, and inserted in

login form can you find my error?
registrationform.php seems fine send data to registration.php
registration.php seems fine checks

CU&UC guide
Hi Gurus,

can anybody provide me the link for CU&UC upgrade guide

Thanks i

Product categories for registration
Dear all,

We are going live with the Supplier registered next week. At standard, the 'sel

passing an array of objects after submit
How do I do this? This is what I have tried and it is not working.

<form method="

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash