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
PHP Multiples of 2, Show posts...not working (wordpress)
I have been using this code to show div.example with 6 li columns inside it, each li is a post with
Problem with HTML form
Hello,
I made a HTML form with some fields and check box.
Everything works fine except whe
URL Rewrite issue
Im created a series of Rewrites and on page checks to make sure the correct url is being called. But
date function help
i need help with date function
Code: [Select]<!DOCTYPE HTML PUBLIC "-//W3C//DTD H
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
what is wrong with this
Code: [Select]<?php
if ($_SERVER['HTTP_REFERER'])
{
Filename like the user name
I am creating a form and storing the values in file. Could anyone please tell me how to write a code
A little help needed passing hidden values to next page
I have a page that has hidden values in a form.
example
Code: <input name='signupID
Undefined offset when using a flat file with pipe symbols
Hi, I've got a flat file/text file which I'm currently using as a member database for my site (not a
Help with form post data and arrays
Hi all,
I am new to this forum... It has been awhile since i have worked with arrays, and i a
Passing vars to the DB
I have 3 small testing tables:
ID TYPE
1 pepperoni
2 C. bacon
3 taco
ID TY