Jump to content


Photo

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


  • Please log in to reply
4 replies to this topic

#1 Monshery

Monshery
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 30 June 2006 - 11:38 AM

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

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 30 June 2006 - 12:00 PM

There's a section in your php.ini that looks like this:

[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

You just need to point those at your SMTP server.

#3 Monshery

Monshery
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 30 June 2006 - 12:17 PM

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

#4 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 30 June 2006 - 12:30 PM

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.

#5 Monshery

Monshery
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 30 June 2006 - 01:12 PM

thanks very much

i will try to understand how to do it . its not simple though




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users