PHP not sending email to email addresses that have 2 dot ('.') characters in their name -
i have been struggling send email using mail function in php while. want send 2 separate emails 2 different email addresses.
$allowhtmlheader = "mime-version: 1.0\r\n"; $allowhtmlheader .= "content-type: text/html; charset=iso-8859-1\r\n"; $headers = "from: webmaster@xyz.com\r\nreply-to: webmaster@xyz.com\r\n" . $allowhtmlheader; $customerheaders = "from: a.b.c@gmail.com\r\nreply-to: a.b.c@gmail.com\r\n" . $allowhtmlheader; $subject = "enquiry"; $message = "try me..."; $cmessage = "i score better!"; if ($_post[cemail] != null) { if (mail("a.b@gmail.com", $subject, $cmessage, $cheaders)) { echo("message sent!"); } else { echo("message delivery failed..."); } if (mail("a.b.c@gmail.com", $subject, $message, $headers)) { echo("message sent!"); } else { echo("message delivery failed..."); } }
using above code, send emails a.b@gmail.com . in attempts not single mail reached a.b.c@gmail.com, though reached a.b@gmail.com. tried replacing a.b@gmail.com a.b.c@gmail.com , yet no mail sent email address alone.
maybe mail function not work emails having more 1 dot '.' in names?
any appreciated!.
solved:
following pagerange`s advice, attempted removing dots / periods ('.') "to" email addresses , emails sent flawlessly!.
Comments
Post a Comment