$html_msg .= Greetings, $toname! ; $html_msg (Web site hosting) .= ; $html_msg
$html_msg .=
Enjoy! ; $html_msg .=
; $temp = gettimeofday(); $msec = (int) $temp[ usec ]; $msgid = md5(time() . $msec); require( ./includes/conn_comic.php ); $sql = INSERT INTO confirm (validator, to_email, toname, from_email, . fromname, bcc_email, cc_email, subject, postcard, message) . VALUES ( $msgid , $to , $toname , $from , . $fromname , $bcc , $cc , $subject , $postcard , $messagebody ) ; $query = mysql_query($sql, $conn) or die(mysql_error()); $confirmsubject = Please Confirm your postcard ; $confirmmessage = Hello . $fromname . ,nn ; $confirmmessage .= Please click on the link below to confirm that . you would like to send this postcard:nn ; $confirmmessage .= $html_msg . nn ; $confirmmessage .= Click here to confirm ; $textconfirm = Hello . $fromname . ,nn ; $textconfirm .= Please visit the following URL to confirm your . postcard:nn ; $textconfirm .= http://localhost/bp5am/ch11/confirm.php . ?id=$msgid ; $message = This is a Multipart Message in MIME formatn ; $message .= –$boundaryn ; $message .= Content-type: text/html; charset=iso-8859-1n ; $message .= Content-Transfer-Encoding: 7bitnn ; $message .= $confirmmessage . n ; $message .= –$boundaryn ; $message .= Content-Type: text/plain; charset= iso-8859-1 n ; $message .= Content-Transfer-Encoding: 7bitnn ; $message .= $textconfirm . n ; $message .= –$boundary– ; $mailsent = mail($from, $confirmsubject, $message, $headers); if ($mailsent) { echo Here is the postcard you wish to send.
; echo A confirmation e-mail has been sent to $from.
; echo Open your e-mail and click on the link to confirm that you would like to send this postcard to $toname.
; echo Subject: $subject
; echo Message:
; echo $html_msg; } else { echo There was an error sending the email. ; } ?>