Hi i have made a script which i need to send to send to my list of database over 300 000 emails. But when i send over to the mail for testing, and when i recieved the mail i need to right click on my picture to press download from my windows outlook to view the picture. can i know how to make it to the way when i send to my customers it will auto show the pictures out like those spam virgra pictures to my mails ? $query = mysql_query("SELECT * FROM VB_Email where SENT = 0"); while($r=mysql_fetch_row($query){ $tosend = $r[1]; $headers = "From: webserver@localhost\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $theFile = "dreamchat.jpg"; $content_encode = chunk_split(base64_encode($theFile)); $boundary = '-----=' . md5( uniqid ( rand() ) ); $headers .= "Content-Type: multipart/mixed; boundary = $boundary\r\n\r\n"; $message .= "Content-Disposition: inline; filename=\"$theFile\"\n\n"; $body = "--$boundary\r\n" . "Content-Type: text/plain; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n"; $body .= chunk_split(base64_encode("This is the plain text version!")); $body .= "--$boundary\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n" . "Content-Disposition: inline; filename=\"$theFile\"\n\n". "Content-Disposition: attachment; filename=\"$theFile\"\n\n"; $body .= chunk_split(base64_encode(" This the <b>Dreamchat.sg</b> <img src='$content_encode'> version!")); mail($tosend, "An HTML Message", $body, $headers); } PHP:
Don't assign the variables which are always the same in your loop 300.000 times over and over again. Then I'd recommend to send first 100 mails, wait a while, and then send the next 100. If you send 300.000 continuously you will get your DNS blocked by most recipient hosts as they'd consider you as a spammer. I'd also use PHPMailer to send your mails. And you can send the mails as HTML and insert the image.
pictures are blocked by outlook by default, no way to change that......not from a script anyways......
You cannot be guaranteed that images will be automatically shown when people view your email. One of the most important strategies for seeing spam is to ONLY view email as plain text. Some companies forbid employees to view email in any other way and that habit has carried over into their personal lives. There is a debate within my company over whether to strip all pictures attached to emails as soon as they reach our primary mail server. Solving your problem requires that the message be formatted as if it were a web page. You will call the inline message from within the email. When I have time, I will be creating such an email message, except that the image will reside on our server and email client's will either auto download the image, or people will click on the link. To maximize clicking, we will make the image something uniquely useful to the target audience. In my application, it will be a graph representing key data in an article sent to a subscribers on a list that they pay to join.
Do it the other way. Put the class into the while() loop. include('class.phpmailer.php'); $mail = new PHPMailer(); $mail->isSMTP(); $mail->FromName = 'Your company name or whatever'; $mail->Host = 'your-host.com'; $mail->From = 'info@your-host.com'; $mail->Subject ='Subject goes here'; $mail->WordWrap = 80; $mail->Body = 'Your body content'; while($r=mysql_fetch_row($query)) { $mail->AddAddress($r['email']); } $mail->Send(); PHP: http://phpmailer.sourceforge.net/tutorial.html
hii guys small prob related to images inline..i have stored the image in database in form of blob and now i want to send the picture inline in a mail how to do it...
Hi all, Please suggest me a way so that i can send images in mail as inline attachment because i think this is only way by which i can show images in mail without asking for an option to download the images. Thank you Dheerendra