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
Auto install
Hi I have a directory lets say "apps" that I then have more folders ie "email",
Querying info from one table based on info in another
Hi, I am currently trying to make a part for my user driven website where one user can subscribe to
This is driving me nuts!
This insert query looks to be alright, however I get this error:
QuoteYou have an error in yo
php email checker
I am having alot of trouble finding info on how to do these email things. I need to do the following
present value of sequence?
Hi
Please help me to find out the present value of sequence?
Thanks
How would I convert this into code using an if statement?
ES equals exam score m equals $mean s equals $total. I already coded my mean and total so I'm not g
Shuffle Array
Hi,
I am writing a script for a game that needs players to randomly be assigned a target (ano
PHP & Java
Hello,
can PHP code be used inside java code?
Code: <SCRIPT LANGUAGE="Java
Empty text file when there is over XXXX lines of text.
define("RANDOM_FILE","/public_html/random.txt");
$randomEntry = "
Delete all from a table
I can not get the following code to work. If I run the sql statement in the db it will delete all t