linux - Sending a mail via php script in ubuntu -


I am trying to send my gmail id to Ubuntu via php script but it is unable to send my code

  & lt; Html & gt; & Lt; Head & gt; & Lt; Title & gt; Send mail & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt ;? Php $ name = $ email = $ query = ""; If ($ _ server ["REQUEST_METHOD"] == "POST") {$ name = test_input ($ _ POST ["name"]); $ Email = test_input ($ _ POST ["email"]); $ Query = test_input ($ _ POST ["query"]); If (mail ("abc@gmail.com", "subject", $ query, "sender: $ email \ n")) {resonant "send email"; } Else {resonance "do not send"; }} Function test_input ($ data) {$ data = trim ($ data); $ Data = stripsash ($ data); $ Data = htmlspecialchars ($ data); $ Return data; }? & Gt; & Lt; Form method = "post" action = "& lt ;? php echo ($ _SERVER [" PHP_SELF "]) ;; & gt; & Gt; Name: & lt; Input type = "text" name = "name" required & gt; Email ID: & lt; Input type = "email" name = "email" required & gt; Query: & lt; Textarea name = "query" line = "5" cols = "40" required & gt; & Lt; / Textarea & gt; & Lt; Input type = "submit" value = "submit" & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

I have configured my php.ini

  [mail function]; For Win32 only; Http://php.net/smtp SMTP = Localhost; Http://php.net/smtp-port smtp_port = 25; For Win32 only; Http://php.net/sendmail-from; Sendmail_from =; For Unix only you can supply logic as well (default: "sendmail -t -i"); Http://php.net/sendmail-path sendmail_path = "/ usr / sbin / sendmail -t -i" extension = php_openssl.dll // removed semicolon  

output / var /log / Mail.log

  27 July 11:09:59 AK-Virtualbox Postfix / SMTP [5598]: 7069320869: to = & lt; Abc@gmail.com>relay = gmail-smtp-In.l.google.com [74.125.129.26]: 25, delay = 4.9, delay = 0.08 / 0.08 / 2.9 / 1.8, DSN = 5.7.1, position = Bounce (host Gmail- smtp-in.l.google.com) [74.125.129.26] said: 550-5.7.1 [14.98.28.24 12] Our system has detected that this message is 550-5.7.1, Perhaps the unsolicited mail. To reduce the amount of spam sent to Gmail, 550-5.7, this message has been blocked. 550-5.7.1 http://support.google.com/mail/bin /answer.py?hl=en&answer=188131 550 5.7.1 For more information, please see Kr8si13914201pbc.32 - GSMTP (Data Commands Count In reply to th) July 27 11:09:59 Elk-Virtualbox Postfix / CleanUp [5 9 6]: 4 AA 162086 D: Message-ID = & lt; 20140727053959.4AA162086D@ak-VirtualBox> July 27 11:09:59 Elk-Virtualbox Postfix / QMGR [4781]: 4 AA 162086D: from = & lt; & Gt;, Size = 2908, NRCPT = 1 (Qi active) 27 July 11:09:59 Elk-Virtualbox Postfix / Bounce [5606]: 706932086 9: Sender Non-Delivery Information: 4AA162086D 27 July 11:09:59 Single-Virtualbox Postfix / qmgr [4781]: 7069320869: Deleted 27 July 11:09:59 Elk-Virtualbox Postfix / Local [5608]: 4 AA 162086 D: = ATM = AK-Virtualbox & gt; Relay = Local, Delay = 0.12, Delay = 0.06 / 0.01 / 0.0 / 0.05, DSN = 2.0.0, Status = Sent (Delivered to Mailbox) 27 July 11:09: 59 AK-Virtualbox Postfix / QMGR [4781]: 4 AA 162086 D: Deleted  

When I submit the form, sending this email (according to my script) is showing, but I am receiving my email Gmail ID. Am I missing a configuration and installation?

Any help would be appreciated

In your first line, Tells:

Our system has found that this message is 550-5.7.1, probably the unsolicited mail. To reduce the amount of spam sent to Gmail, 550-5.7.1 this message has been blocked. 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 550 5.7.1 Please see for more information. Kr8si13914201pbc.32 - GSMTP (in the north at the end of the data command))

Reputation of domains sending Gmail (and most mailing service), a combination of sending mail transfer / server status Blacklisted etc.), number of request frequency, number of recipients, and mail content to determine if mail is spam or not.

If it determines that it is not, it transmits it to the inbox, in the case of moderate intensity it routes to the spam folder. If the rating is actually low, then it blocks the mail as your block.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -