email
Posted by: frenchsquared (---.hsd1.co.comcast.net)
Date: October 28, 2007 06:24PM

I did not set my stmp when i installed WAMP.
How do I go back and change it?

Options: ReplyQuote
Re: email
Posted by: toivo (203.19.130.---)
Date: October 29, 2007 08:26AM

Hi,

Edit your php.ini configuration file c:\wamp\apache2\bin\php.ini. Find the following lines:


[mail function]
; For Win32 only.
SMTP = nnn.nnn.nnn.nnn

and replace nnn.nnn.nnn.nnn with the IP address of your SMTP server.

Regards,



toivo
Sydney, Australia

Options: ReplyQuote
Re: email
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: October 29, 2007 08:22PM

wamp does not come with an smtp server, so no mater what changes you make you will not be able to send email. running a smtp server is a HUGE security risk, especialy for a newbie. I use a open source php class called phpmailer to program email functionality into my php scripts.

phpmailer.sourceforge.net


note, just added this to your scripts will not make emails work. you will need to program your scripts yourself to get it to work.



CyberSpatium
----------------------
WAMP English Forum Admin

I have WAMP5 working with (for development use only):
Windows Vista Ultimate x64 (64 bit)
Kaspersky Internet Security Suite 7.0.x
Spyware Terminater 2.x
CounterSpy 2.5.x


Need help? Check out my WAMP User Manual/Guide here!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote
Re: email
Posted by: toivo (203.19.130.---)
Date: October 30, 2007 02:40AM

Hi,

CyberSpatium is right, you need to use a mailer class or just the mail() command which is part of PHP. However, be careful how you use it because it is up to you to sanitize the data that is passed to the command as address parameters. Sending emails where you have static addresses is fine, but as soon as you accept data from forms, you can run into all sorts of spamming problems unless you validate the input data properly.

Regards,



toivo
Sydney, Australia

Options: ReplyQuote
Re: email
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: October 30, 2007 06:48PM

once again, wamp does not come with an smtp server, so php mail() function will not work.


CyberSpatium
----------------------
WAMP English Forum Admin

I have WAMP5 working with (for development use only):
Windows Vista Ultimate x64 (64 bit)
Kaspersky Internet Security Suite 7.0.x
Spyware Terminater 2.x
CounterSpy 2.5.x


Need help? Check out my WAMP User Manual/Guide here!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote
Re: email
Posted by: toivo (203.19.130.---)
Date: October 31, 2007 10:26AM

Hi,

WAMP does not have to come with an SMTP server for the PHP function mail() to be able to send messages through a relaying server. The mail() function works happily, passing the email messages to the SMTP server specified in the php.ini file.

Here is an example of a function that is being called from a scheduled command line script to inform the webmaster that the daily database backup has finished:

<?php
/**
* @20070908 toivo@totaldata.biz send mail - adapted from examples on the net
*/

function sendEmail($to, $subject, $message, $from = NULL, $reply_to = NULL, $cc = NULL) {

// build headers
$headers = "";
if ($cc) {
$headers .= "Cc: " . $cc . "\r\n";
}
if ($from) {
$headers .= "From: " . $from . "\r\n";
}
if ($reply_to) {
$headers .= "Reply-To: " . $reply_to . "\r\n";
}
$headers = "X-Mailer: PHP/" . phpversion();

// max 70 characters per line
$message = wordwrap($message, 70);
// windows and full stop on the start of a line
$message = str_replace("\n.", "\n..", $message);

// send mail
if (mail($to, $subject, $message, $headers)) {
$status = "mail was sent to $to";
} else {
$status = "mail could not be sent to $to";
}
return $status;
}
?>



toivo
Sydney, Australia

Options: ReplyQuote


Sorry, only registered users may post in this forum.