Jump to content


This topic is now archived and is closed to further replies.


How do i set my php.ini or something to beabale to send mail from php code

Recommended Posts

well i have this code for sending the mail :
  $to = $_POST['REMAIL'];
  $subject = "Activation details - MMODATE -";
  $message = "Congratulation \r".$_POST['RUSERNAME']." \r for signing up with MMODATE your one step from beeing an active memeber of MMODATE<BR><BR>". 'Please click on this link to activate your account <BR> <a href= "http://localhost/Yanivs/MMO-Date/Activation.PHP?USDC='.$checkbig .'&USDP='.$_POST['RPASSWORD'] .'">http://localhost/Yanivs/MMO-Date/Activation.PHP?<a>';
  $message = wordwrap($message, 70);
  $headers  = 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  $headers .= 'From: MMODATE <Monshery@localhost>' . "\r\n"; /* i am not sure what i am suppost to put in this */
  mail($to, $subject, $message, $headers);

well i am getting this error:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 20, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Yanivs\MMO-Date\Register.PHP on line 451

Any help on how to configer my INI's would me amazing i am useing wamp server pack . thanks in advanced

Share this post

Link to post
Share on other sites
There's a section in your php.ini that looks like this:
[quote][mail function]
; For Win32 only.
SMTP = mail.my-domain.co.uk ; for Win32 only

; For Win32 only.
sendmail_from = mail@my-domain.co.uk ; for Win32 only[/quote]
You just need to point those at your SMTP server.

Share this post

Link to post
Share on other sites
but what is my smtp server lol ? i only instaled Wamp server have no idea about smtp mate at least for now.

thnx for help though

Share this post

Link to post
Share on other sites
An SMTP server is your outgoing mail server, you normally get a mailserver along with your web hosting package and domain name, it is usually something like mail.your-domain.com or smtp.your-domain.com. If you don't currently have any hosting and just want to send mail from your local machine, you can normally use your ISPs outgoing mail server. You'd have to ask your ISP what this is, either give them a call, look on their site or in any documentation you got when you signed up for your internet subscription.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.