I'm writing a program to send html
embedded mail. For this purpose I've used NicEdit - WYSIWYG editor. When I do send a mail, the images disappears in the mail.
In php mail()
I've used headers
as:
$header="From: no-reply@prithviassociates.org
X-Mailer: PHP/".phpversion()."
".
"MIME-Version: 1.0
Content-type: text/html; charset: utf8
".
"Reply-To: info@prithviassociates.org
Bcc: ".$recipients."
";
where $recipients
contains the email addresses of recipients.
Any solution of this problem?
Code
NicEdit Configuration
<script src="js/nicedit.js"></script>
<script>
$(document).ready(function() {
new nicEditor().panelInstance('message');
});
</script>
HTML mailer form
<form method="post" action="mailProcess.php">
To <input type="text" name="recipients">
Subject <input type="text" name="subject">
Message
<textarea cols="70" rows="15" name="message" id="message"></textarea>
</form>
mailProcess.php
$recipients = $_POST['recipients'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$header = "From: no-reply@prithviassociates.org
X-Mailer: PHP/" . phpversion() . "
" .
"MIME-Version: 1.0
Content-type: text/html; charset: utf8
" .
"Reply-To: info@prithviassociates.org
Bcc: " . $recipients . "
";
If I do upload an image then NicEdit
gives a link like <img width="524" src="http://i.imgur.com/ycyrMau.jpg"></img>
and when I submit the form for mailing the image disappears from the mail message
With the help of gmail
I'm able to tackle with this problem.
In gmail
(standard view) I found Message text garbled?
which showed me the actual content of the mail, which was in my case: <img src=\"http://i.imgur.com/CvToS30.jpg\" width=\"176\">
. It contains \
s before every "
which I've removed from stripslashes()
as:
$message = stripslashes($_POST['message']);
and now it works.
Have you checked your mail logs
? Is there any link to an image or error of some sort?