Jump to content

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 :
[code]
  $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);
[/code]

well i am getting this error:
[quote]
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
[/quote]


Any help on how to configer my INI's would me amazing i am useing wamp server pack . thanks in advanced
Link to comment
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.
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.