email - send mail using php using xampp -


I can not send mail, can anyone help with it? I tried to surf but I have not got any answer yet. I'm using an application called XAMPP, is this the reason for this? Are all php functionalities in XMPP?

This is a mailform

  & lt ;? Php $ to = "ratisharabidze@gmail.com"; $ Theme = "test mail"; $ Message = "Hello! This is a simple email message."; $ From = "ratisharabidze@yahoo.com"; $ Headers = "to: $ sec"; Mail ($ to $, $ theme, $ message, $ header); Resonant "mail sent."; ? & Gt;  

This is a form.html

  & lt; Html & gt; & Lt; Body & gt; & Lt ;? Php Function SpamCak ($ ​​field) {// Eregi ()) matches a case insensitive regular expression (ifiage ("copy:", $ field) || erogee ("cc:", $ field)) {return true ; } And {return false; }} // If "email" is filled, send email (isset ($ _ request ['email']) {// check that email address is invalid $ mailcheck = spamcheck ($ _ request ['email'] ); If ($ mailcheck == true) {echo "invalid input"; } Other {// send email $ email = $ _REQUEST ['email']; $ Theme = $ _REQUEST ['subject']; $ Message = $ _REQUEST ['message']; Mail ("someone@example.com", "subject: $ subject", $ message, "sender: $ email"); "Thank you for using our mail form"; }} And // If the "email" is not filled, display the form {echo "

subject: & lt; input name =' subject 'type =' text '/> message: & lt ; Br / & gt; Text field name = 'Message' rows = '15' cols = '40' & gt; & lt; / textarea & gt; & lt; br / & gt; Input Type = 'Submit Do '/> & lt; / form & gt; "; ? & Gt; & Lt; / Body & gt; & Lt; / Html & gt;

Since you are new, the free most of the use of Gmail The easiest way is the SMTP server .

Edit XAMPP in your php.ini (in Control Panel, click the config button Next to Apache and select php.ini ).

Find the line below in that file. sendmail_path uncommitted by removing from the beginning of the semi-colon line

; Sendmail_path = "\" C: \ XAMPP \ Sendmail \ sendmail.exe \ "-t"

Forward your sendmail settings for Gmail:

smtp_server must be mail.gmail.com. auth_username and auth_password your Gmail username and password will be smtp_port 465.

Restart XAMPP and if everything is okay, then it will be good to go.


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 -