0

I'm pretty new to PHP. I need to send an email from a webpage and thought that my code was good, but it's not sending anything. I can't see what i am doing wrong...

<?php
echo ("Thank you.")
$msg = "Some email message for testing. Please disregard if you receive this in your email.";
$msg = wordwrap($msg,70);
mail("email1@internet.com","Subject Verbiage",$msg);
mail("email2@internet.com","Subject Verbiage",$msg);
?> 

Any help would be very appreciated.

John Conde
  • 217,595
  • 99
  • 455
  • 496
larryb
  • 25
  • 3
  • 1
    Please don't try to use php mail functions on your own. Use a library like swiftmailer. It will make your headers rich, as well as encrypt and allow complex emails such as using domain keys. – Satbir Kira Sep 01 '15 at 13:44
  • Thank you for the advice, i appreciate it. I'm just trying to send a simple email when people land on a particular webpage...and am not sure what's wrong with my code. I've even looked at the php.ini and it looks like it should work. – larryb Sep 01 '15 at 14:51
  • Solved the problem...i neglected to put in the 'sent from' field. So the fixed mail line is... mail("email@internet.com","Subject Verbiage","An email test message", "website@internet.com"); – larryb Sep 01 '15 at 15:01

0 Answers0