i want to be able to send mails using php. i have no experience in this. i got some scripts like http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php. I want to send a html mail which needs to be formed using data from a mysql database. I have email addresses stored in a database and want to design a script to get addresses from it and call mailing function to form accordingly html message and send it Please help me, give me any method to send html mails formed using database data and which can be called in the form of a function so tht i can automate sending
Ben ME BU HATA SÖYLEYİN LÜTFEN kullanıyorum kodu EKLEDİK ... Wen ben ÇALIŞ BU SENARYO BİR AN BOŞ ATTACHMNT İLE BOŞ POSTA KODU MY GÖNDERİLİR
\r\nReply-To: contact@mydomain.com"; //add boundary string and mime type specification $headers .= "\r\nContent-Type: multipart/alternative; boundary=\"".$random_hash."\""; //define the body of the message. ob_start(); //Turn on output buffering
$ random_hash echo;
echo '
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit';
echo '
Hello World!!!
This is simple text email message.';
$ random_hash echo;
echo '
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit ';
echo '
gfhjfjhfjhjjgkgk
';
$ random_hash echo;
//copy current buffer contents into $message variable and delete current output buffer $message = ob_get_clean();;
//echo $headers." "; echo $message; //send the email $mail_sent = @mail( $to, $subject, $message, $headers ); //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" echo $mail_sent ? "Mail sent" : "Mail failed"; ?>