User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,605 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,608 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting

Email code problem

Join Date: Feb 2008
Location: Trinidad
Posts: 386
Reputation: maydhyam is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
maydhyam's Avatar
maydhyam maydhyam is offline Offline
Posting Whiz

Re: Email code problem

  #9  
May 16th, 2008
Great, it works now...I've even set it to send mails in HTML and not plain text.....

  1. //send email
  2. $to = "somebody@somewhere.com";
  3. $subject = "blah blah";
  4. $from = "TAIS Application";
  5.  
  6. $msg = "<html><head><title>blah blah</title></head>";
  7. $msg .= "<body><table><tr><th align='left'><font face='verdana' size='2'>Dear System Administrator,</font></th></tr>";
  8. $msg .= "<tr><th align='left'>&nbsp;</th></tr>";
  9. $msg .= "<tr><th align='left'><font face='verdana' size='2'>User <font color='red'>".$myrow['FirstName']." ".$myrow['LastName']."</font> (<font color='red'>".$empNo."</font>) has blah blah.</font></th></tr>";
  10. $msg .= "<tr><th align='left'><font face='verdana' size='2'>Kindly fix that problem.</font></th></tr>";
  11. $msg .= "<tr><th align='left'>&nbsp;</th></tr>";
  12. $msg .= "<tr><th align='left'><font face='verdana' size='2'>Regards</font></th></tr>";
  13. $msg .= "<tr><th align='left'><font face='verdana' size='2'>TAIS Administration</font></th></tr></table></body></html>";
  14.  
  15. $headers = "MIME-Version: 1.0" . "\r\n";
  16. $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
  17. $headers .= "From: ".$from."\r\nReply-To:someone@somewhere.com" . "\r\n";
  18.  
  19. $mailsend = mail("$to","$subject","$msg","$headers");
  20. echo $mailsend ? "<img src='images/emailGone.gif' /> Notification was sent." : "<img src='images/emailNotGone.png' /> Notification sending failed.";
The man who in view of gain thinks of righteousness; who in the view of danger is prepared to give up his life; and who does not forget an old agreement however far back it extends - such a man may be reckoned a complete man.
~ Confucius, The Confucian Analects
Reply With Quote  
All times are GMT -4. The time now is 12:03 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC