Problem began with Magento not sending mails, and while debugging I came to this:
when using PHP mail function, it fails if $to contains Name.
<?php
$to = '<myname@gmail.com>'; //Works fine
$to = 'myname@gmail.com'; //Works fine
$to = 'Myname <myname@gmail.com>'; // This doesn't work! No mail and getting "delivery failed";
$subject = "Test";
$body = "How are you?";
if (mail($to, $subject, $body)) {
echo("Message successfully sent!");
} else {
echo("Message delivery failed...");
}
?>
This is a hosted account, so I don't have access to sendmail or any other configs.