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. */
$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
button help
i originally had this but realised it is much easier to have a button.
Code: <?php
Display last record first.
I need some help how put the last record first and first record last.
Thanks
Code: &am
Gaining access to Drop Down Menu Variable
code is below, I am creating a drop down menu. I want to echo the value selected in the drop down me
CURL XML Request [From C to PHP]
Hi,
I need some help converting this into something that will work with PHP.
Code: #
animation progress while uploading files?
Hello, i have some website form to upload few files to server. i want to put some gif animation whi
Am I setting up my sites oldschool?
Ok,
When I create a site I open a basic template that I have created that consists of a css f
PHP switch function help
Hi, I am trying to create a search function for a directory website. On the search function on html
Problem executing bash script using shell_exec
Hi there,
I created a bash script file using following code to convert doc documents to pdf using
Perplexing problem showing a .jpg
Please disregard..........I figured it out
urldecode question
How would I format this line of code properly?
<?php echo urldecode($_GET['Title']); ?