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
Gantt Chart Tool
Does anyone know of a good free gantt chart creator tool
Thanks
distinct rows
Hi
version 10.2.0.3
I have a query output something like the following
ID
download directory onto C drive
I am attempting (if this is possible) to write a routine to automatically dump the contents of a dir
help need on ob_start()
Hi
I am a newbie in php, I have a code
Line number On/Off | Expand/Contract <?phpo
PHP login form help (Done Most of It)
Hi i am having a problem, when i try logging in it is always saying "Invalid Login" im not
array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e
RadioButtonList data selection
view plaincopy to clipboardprint?Renaming array keys
The issue: renaming array keys inside a foreach loop.
I'm trying to build a pie chart image w
textfield unchanged
hi,
i want my form to know whether its textbox is unchange or not.
if($textbox == 'unchang
Auto fill in input value based on User_ID
Hello,
I'm looking form some input on the following problem.
User loads page ->