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
Procedural to OOP
ohn Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pri
Production Order Enterprise Service to Manufacturing Exctn Sys (MES) ???
Hello Experts,
In our current landscape SAP ECC 5.0 is integrated to MES system via PI 7.
query help
Hi experts.
i have a table rep2 like this
PROD_COD ACCT_NO DUE_DAYS BALANCE
Packet Design
Hi All,
Im new about network programming and I want to design a protocol but I have some question
Open browser page depending on XML results
Hello,
I have some PHP code that sends webbased from data to an external url ( in the form of
PHP4 to PHP5 Conversion
Hi Everyone,
I am working on a site that is built up on PHP4 and each page is being started f
MSSQL/PHP
I am tryint to setup a webapplication developed in PHP, Apache2.0 and SQLServer2000 as backend which
Am i doing this wrong?
Im pulling from an Oracle database some info... one of which is a field count_pnums which is a NUMBE
ORA-00932: inconsistent datatypes: expected - got CLOB
SO : windows xp
database : XE
there is a table (transito) with two fields of clob
removing space from the end of a variable
i have a variable $image which contains the following url "http://tiles.xbox.com/tiles/oo/P5/0m