0

I'm actually using the PHP code below to send a mail at my "@me" address:

<?php
$to      = 'myName@me.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

It works fine with Gmail but I'm not receiving any mail when trying to use with my iCloud mail address...any idea of how to make this work?

Sara Canducci
  • 6,231
  • 5
  • 19
  • 24

2 Answers2

0

If you are sending small amount of mails, you should use PHPMailer as it will give you the flexibility to send mails to any service with any configurations needed, easy attachment and everything you may need.

Hope it helps!

Happy Coding !!!

Ayush Ghosh
  • 487
  • 2
  • 10
  • Hi, I just need to send a mail once in a while for a simple "password forgotten" reminder ;) – Sara Canducci Aug 02 '14 at 13:59
  • Which mail server are you using, in mail, it uses the local mail server of your computer, in XAMP or WAMP etc. So Gmail may be accepting g it but marked fraud by iCloud. as Mail have designated whitelist servers. – Ayush Ghosh Aug 02 '14 at 14:14
0

Depends on your server mail configuration. Try using libraries like PHPMailer to send mails to anywhere. Also it needs to enable IMAP to get this mail sending to work. http://phpmailer.worxware.com

Bineesh
  • 326
  • 4
  • 9