So...I have installed wampserver in my computer, so I'm trying t send a email contact form en PHP to any other email company like gmail or yahoo,I'm working in dreamweaver but I don't know exactly how to do this because I got that message.I tried with Phpmailer , :
/* Subject and Email Variables */
$emailSubject = 'EmailMe!'; $webMaster = 'XXXXX@XXXXXX.XXX'; /* Gathering Data Varibles */
$nameField = $_POST['name']; $emailField = $_POST['email']; $phoneField = $_POST['phone']; $commentsField = $_POST['comments']; $body = <<<EOD<br><hr><br>Name: $nameField <br>Email: $emailField <br>Phone Number: $phoneField <br>Comments: $commentsField <br>EOD;
$headers = "From: $emailField\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailsubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head>
<body> [ background-color: #f1f1f1; font-family: Verdana, Arial,Helvetica,sans-serif: font-size: 12px;font-style: normal; line-height: normal; font-weight: normal; color: #666666; text-decoration: none;]--><style><head>
<div> <div align="left">Thank you for your interest your email will be answer very soon</div></div><body><html>EOD;
echo "$theResults"; ?>
You should have a php.ini file somewhere in your php installation.
If you cannot locate that, it will be Most likely at :
Look for the following in your PHP.ini file
Locate these lines
My configuration Php.ini
[mail function]; For Win32 only.SMTP = smtp.gmail.comsmtp_port = 587
; For Win32 only.;sendmail_from = XXXXX@XXXXXX.XXX.
Thank you for Reply ...but I had the same error..the point is I would like to send the message to my email gmail or hotmail I dont like use outlook . so let me know please is the correct configuration.
Thank you so much, ask for aditional info
I tried the second option,now is better, no error, but I didn't recieved any email in my account Gmail.
No I didn't,
; configuration for fake sendmail
; if this file doesn't exist, sendmail.exe will look for the settings in; the registry, under HKLM\Software\Sendmail
; you must change mail.mydomain.com to your smtp server,; or to IIS's "pickup" directory. (generally C:\Inetpub\mailroot\Pickup); emails delivered via IIS's pickup directory cause sendmail to; run quicker, but you won't get error messages back to the calling; application.
; smtp port (normally 25)
; SMTPS (SSL) support; auto = use SSL for port 465, otherwise try to use TLS; ssl = alway use SSL; tls = always use TLS; none = never try to use SSL
; the default domain for this server will be read from the registry; this will be appended to email addresses when one isn't provided; if you want to override the value in the registry, uncomment and modify
; log smtp errors to error.log (defaults to same directory as sendmail.exe); uncomment to enable logging
; create debug log as debug.log (defaults to same directory as sendmail.exe); uncomment to enable debugging
; if your smtp server requires authentication, modify the following two lines
; if your smtp server uses pop3 before smtp authentication, modify the ; following three lines. do not enable unless it is required.
; force the sender to always be the following email address; this will only affect the "MAIL FROM" command, it won't modify ; the "From: " header of the message content
; force the sender to always be the following email address; this will only affect the "RCTP TO" command, it won't modify ; the "To: " header of the message content
; sendmail will use your hostname and your default_domain in the ehlo/helo; smtp greeting. you can manually set the ehlo/helo name if required
[mail function]; For Win32 only.SMTP = ;smtp_port = 587
; For Win32 only.;sendmail_from =
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").sendmail_path =c:\wampsendmail\sendmail.exe -t
I'm sorry it doesn't work yet....... have this error log:
09/07/01 22:26:48 : Connect timed out.09/07/01 22:30:19 : Authentication failed.<EOL>09/07/01 22:44:10 : Message is missing sender's address09/07/01 22:45:36 : Authentication failed.<EOL>09/07/05 11:47:30 : Must issue a STARTTLS command first. k37sm25031552rvb.58<EOL>
Bebug error in Sendmail:
09/07/05 11:47:29 ** --- MESSAGE BEGIN ---09/07/05 11:47:29 ** To:XXX@XXXXXX.XXX09/07/05 11:47:29 ** Subject: 09/07/05 11:47:29 ** From:XXX@XXXXXX.XXX09/07/05 11:47:29 ** Content-type: text/html09/07/05 11:47:29 ** 09/07/05 11:47:29 ** 09/07/05 11:47:29 ** <br><hr><br>09/07/05 11:47:29 ** Name: Edgardo Domingo <br>09/07/05 11:47:29 ** Email:XXX@XXXXXX.XXX <br>09/07/05 11:47:29 ** Phone Number: XXXXXXXXX <br>09/07/05 11:47:29 ** //Spending Plans: <br>09/07/05 11:47:29 ** //Number of Items: <br>09/07/05 11:47:29 ** Comments: fdgdfdfghdf <br>09/07/05 11:47:29 ** //Newsletter: <br>09/07/05 11:47:29 ** --- MESSAGE END ---09/07/05 11:47:29 ** Connecting to smtp.gmail.com:58709/07/05 11:47:30 ** Connected.09/07/05 11:47:30 << 220 mx.google.com ESMTP k37sm25031552rvb.58<EOL>09/07/05 11:47:30 >> EHLO Eduardo-PC<EOL>09/07/05 11:47:30 << 250-mx.google.com at your service, [126.96.36.199]<EOL>250-SIZE 35651584<EOL>250-8BITMIME<EOL>250-STARTTLS<EOL>250-ENHANCEDSTATUSCODES<EOL>250 PIPELINING<EOL>09/07/05 11:47:30 ** Authenticating asXXX@XXXXXX.XXX09/07/05 11:47:30 >> MAIL FROM: <XXXXX@XXXXXX.XXX><EOL>09/07/05 11:47:30 << 530 5.7.0 Must issue a STARTTLS command first. k37sm25031552rvb.58<EOL>09/07/05 11:47:30 ** Disconnecting from smtp.gmail.com:58709/07/05 11:47:30 ** Disconnected.09/07/05 11:47:30 ** Disconnected.09/07/05 11:47:30 ** Must issue a STARTTLS command first. k37sm25031552rvb.58<EOL>
Okey I tried with the first and didn't work.....so I have to erase sendmail.exe? and install yours?
Sure!!! Worked.....thank you so much