PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in d:\appserv\www\mail.php on line 28
Either use a remote server or install an SMTP service. Windows servers have one you can enable in the control panel. Linux servers can use a number of things like sendmail, qmail, exim...
Alternatively, you can often use your ISP's SMTP server to send mail from PHP. Try using the same SMTP server name as you have for sending mail from your e-mail client.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
Thanks for ur reply.
I download the Swift-1.2.1 and run this in my localhost.
Run this coding
<?php
//Specify secure TLS when we make the connection
$swift = new Swift(new Swift_SMTP_Connection('smtp.gmail.com', SWIFT_SECURE_PORT, SWIFT_TLS));
//Log in to the server
$swift->authenticate('myaccount@gmail.com', 'myaccountpassword');
if (!$swift->hasFailed())
{
$swift->send(
'"To User" <shiri@gmail.com>',
'"Your name" <shiri@aj.com>',
'The subject',
'Your message'
);
$swift->close();
}
?>
But I got this error.
Parse error: syntax error, unexpected T_STRING in d:\appserv\www\Swift.php on line 65
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
<?php
require 'Swift.php';
//Specify secure TLS when we make the connection
$swift = new Swift(new Swift_SMTP_Connection('smtp.gmail.com', SWIFT_SECURE_PORT, SWIFT_TLS));
//Log in to the server
$swift->authenticate('myaccount@gmail.com', 'myaccountpassword');
if (!$swift->hasFailed())
{
$swift->send(
'"To User" <shiri@gmail.com>',
'"Your name" <shiri@aj.com>',
'The subject',
'Your message'
);
$swift->close();
}
?>
Hmm... I'm not sure TLS will work with a windows installation of PHP. It requires OpenSSH to be compiled with PHP.... does windows PHP support ssl:// and tls:// protocols?