Sending mail with Swift from local machine

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Sending mail with Swift from local machine

Post by Oren »

Hey guys,
My situation is simple: I installed WAMP on my PC at work (at home I install everything manually). If that makes any difference, the OS is Vista. Now I want to be able to send mail from this PC using PHP and Swift, but I guess I need to install some sort of SMTP server to be able to do that, but I'm not sure what is involved exactly. So... what exactly I need to do to be able to use Swift from this PC? Plus, what do I pass to Swift_Connection_SMTP()? 'localhost'?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Sending mail with Swift from local machine

Post by Chris Corbyn »

I'd strongly discourage this based on the assumption that your machine has a dynamic IP address. If it as a static IP then yes, you'll need to install a SMTP server. I don't know much about things like this on windows but I understand it has SMTP built in as an optional service.

If your IP is dynamic you'll fail to send email to the majority of hosts since it almost always means your automatically blacklisted. Connect to your company's SMTP server instead :)
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Re: Sending mail with Swift from local machine

Post by Oren »

This specific problem at work is now solved, but I'm still looking for an answer. Assuming I have a normal home connection with dynamic IP and a Windows machine, what are my options?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Sending mail with Swift from local machine

Post by Chris Corbyn »

Your only real option is to pass the mail to a real mail server. The dynamic IP is a big sticking point, even with reverse DNS entries and/or a domain name from something like dyndns.

Sure, you can install a SMTP server in the machine (or use the windows one), but I wouldn't do that if you need to send email to customers or anything :)
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Re: Sending mail with Swift from local machine

Post by Oren »

No, I just want to use it while building my projects locally. Once the project is done, it will run on a real server.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Sending mail with Swift from local machine

Post by John Cartwright »

Oren wrote:No, I just want to use it while building my projects locally. Once the project is done, it will run on a real server.
If you have a gmail account you can connect to the gmail SMTP server
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Sending mail with Swift from local machine

Post by Chris Corbyn »

Ah, in that case just use windows SMTP which is built in. There's an SMTP server written by Marcus Baker (author of SimpleTest) called FakeMail. It's on SourceForge. Basically FakeMail just writes the email to a file on disk instead of actually sending it.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Re: Sending mail with Swift from local machine

Post by Oren »

I'll check it out whenever I'll need it... thanks guys 8)
Post Reply