email - Sending mail in php using pear -
the problem facing @ moment odd. i've used script given below before , has worked charm, not working.
here code:
function send($str){ $from = "body<body@gmail.com>"; $to = "targetname <matthew.s@gmail.com>"; $subject = "questionnaire submission!"; $body = $str; $host = "smtp.gmail.com"; $username = "body"; $password = "pwd"; $headers = array ('from' => $from, 'to' => $to, 'subject' => $subject); $smtp = mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (pear::iserror($mail)) { echo("an error occured during submission! please try again!"); } else { echo("submission successful!!\nyou redirected page fix timings."); } }
now code wont send mail can cannot understand why.
some appreciated.
best regards priyabrata
edit
i received mail account using send mail :
this automatically generated delivery status notification warning message only. not need resend message. delivery following recipient has been delayed: message retried 2 more day(s) technical details of temporary failure: message temporarily rejected. see http://support.google.com/mail/bin/answer.py?answer=69585 more information.
this has nothing pear mail; it's general email issue. pear's mail package can send mails fine - recent php versions 5.5 , 5.6beta1.
try send mail different email address, might work.
also follow gmail's guidelines depicted in support url in response.
in situations recipient gmail user, include:
...
so send mail gmail address, , more information.
Comments
Post a Comment