40 likes | 125 Views
Web Programming Week 9. Old Dominion University Department of Computer Science CS 418/518 Fall 2010 Martin Klein <mklein@cs.odu.edu> 10/26/10. Sending E-Mail. PHP syntax: mail( $to , $subject , $message , $headers ); e.g. <?php mail(" cs518f10@gmail.com ", " My status line ",
E N D
Web ProgrammingWeek 9 Old Dominion University Department of Computer Science CS 418/518 Fall 2010 Martin Klein <mklein@cs.odu.edu> 10/26/10
Sending E-Mail PHP syntax: mail($to, $subject, $message, $headers); e.g. <?php mail("cs518f10@gmail.com", "My status line", "If I could only think of a msg I would put it here..."); echo "congrats, your email was sent"; ?> (see firstmail.php, ch10)
Sending E-Mail $to = "cs518f10@gmail.com"; $subject = "My subject line"; $message = "<h1>If I could only</h1>"; $message .= "<b>think</b>"; $message .= "<i> of a msg</i>"; $message .= "<pre> I would put it here.</pre>"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "Content-Transfer-Encoding: 7bit\r\n"; mail($to, $subject, $message, $headers); (see secondmail.php, ch10)
From mklein@cs.odu.edu Mon Aug 16 09:33:57 2010 Return-Path: <mklein@cs.odu.edu> Received: from mail.cs.odu.edu (darkisland.csnet.cs.odu.edu [128.82.4.212]) by unixmail.cs.odu.edu (8.14.2/8.14.2) with ESMTP id o7GDXuSY015967 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)for mklein@unixmail.cs.odu.edu>; Mon, 16 Aug 2010 09:33:57 -0400 (EDT) … MIME-Version: 1.0 … Subject: Email was hacked, I apologize it is fixed now. From: john doe <jdoe@gmail.com> To: Martin Klein <mklein@cs.odu.edu> Content-Type: multipart/alternative; boundary="001485f626f00069b6048df0e27f“ … --001485f626f00069b6048df0e27f Content-Type: text/plain; charset="ISO-8859-1" In case a message with a link was sent from me my email was corrupted and sent out to my inbox. I have fixed the account and apologize for the inconvenience. John -- John M. Doe --001485f626f00069b6048df0e27f Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable <div>In case a message with a link was sent from me my email was corrupted and sent out to my inbox. I have fixed the account and apologize for the in convenience.</div> <div>=A0</div> <div>John<br clear=3D"all"><br>-- <br>John M. Doe<br></div> --001485f626f00069b6048df0e27f-- Trailing -- indicate end of msg!