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
I apologise! It's a newbie to PHP feedback form problem!
Hi,
I am a total newbie to PHP. I am also a unemployed and need to get a job. So after 100% r
Need help in log in and log out?
hi there all of u. i have recently created a site for someone. i have placed log in and log out and
[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.
If the program exits normally the por
url- go to webpage
i have an input text field and submit button.
how do i make the url entered into the textfiel
Error in SQL Syntax HELP!!!
I have this page:
Code: <?php
session_start();
//connect to server and s
help me, how to find text on an external html site using PHP
Would anyone know how to search an external html file for a work or phrase ?
I was thinking s
Simple code help with redirects
I am trying to figure out a redirect script that detects if the browser is IE 7 and if it does, redi
Mass activity scheduling
Hi experts,
Im facing some problems to deal with mass activity jobs.
When I run some
Error when call dll from oracle
Hi all, please help me!
I have dll write C language, I want call it from oracle procedur
Problem in OnClientClick and OnClick sync
Hi,Strange and irritating problem:
I have below button declaration in markup of the aspx page: