Sending Mail from an Internal LAN - Any Advice? [Solved]

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Sending Mail from an Internal LAN - Any Advice? [Solved]

Postby tweezer » 11. July 2012 09:43

Hello,

I am running XAMPP 1.7.4 on a Windows 7 machine on an INTERNAL LAN. We use it in our office to run PHP/MySQL applications without any access to it opened to the outside world.

But, I would like certain applications to be able to send emails to my staff, such as joe@mycompany.com. We use google apps (gmail) as our mail service provider (that is, mycompany.com is actually gmail).

I've read a lot of different posts, but wondering if someone can give me a nudge in the right direction to get my php applications on my LAN sending emails to my staff at mycompany.com.

Any advice is greatly appreciated!
Cheers,
T.
tweezer
 
Posts: 4
Joined: 11. July 2012 09:27
Operating System: Windows 7

Re: Sending Mail from an Internal LAN - Any Advice?

Postby JonB » 11. July 2012 11:00

You need to use the 'fake sendmail' included with XAMPP. Its found in the xampp\sendmail folder. There's a configuration file for it with (as Irecall) examples in it. If you want tutorials Google 'setup fake semdmail'. (and, of course add the right PHP code) :D

As long as you have an internet connection, it will be able to use Google's SMTP servers to forward your mail.

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Sending Mail from an Internal LAN - Any Advice?

Postby tweezer » 11. July 2012 11:19

Thanks Jon! I have read a bit about this setup. I'll head down that road and let you know how it goes.

Cheers!
T.
tweezer
 
Posts: 4
Joined: 11. July 2012 09:27
Operating System: Windows 7

SOLVED: Sending Mail from an Internal LAN - Any Advice

Postby tweezer » 11. July 2012 13:56

Thanks for your advice Jon. It works now.

I looked at some other stuff out there on this topic, and did the below steps with my setup. Note that I use google apps as my email service provider. That is, email to user@mydomain.com goes to gmail and is handled there.

Edited the php.ini file as follows:

Under the [mail function] area:
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 587

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from =username@mydomain.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

The I edited the sendmail.ini file as follows:

smtp_server=smtp.gmail.com

smtp_port=587

default_domain=mydomain.com

auth_username=username@mydomain.com
auth_password=xxxxxxxx

force_sender=username@mydomain.com

hostname=mydomain.com

STOPPED AND RESTARTED APACHE!!!

Then I used the test php script I found here: http://www.daniweb.com/web-development/php/threads/347696/sending-email-from-localhost-in-xampp-windows

And it worked! :D

It also works for my applications.

Thanks again,
T
tweezer
 
Posts: 4
Joined: 11. July 2012 09:27
Operating System: Windows 7

Re: Sending Mail from an Internal LAN - Any Advice? [Solved]

Postby JonB » 11. July 2012 14:25

Great - I'm glad its working. and thanks for posting how you got things working.

LOL - I use it for the "Excruciatingly Correct Guide" 's XAMPP server (found in my 'sig' line), so I was pretty sure you would get it working.

Good Luck with XAMPP
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Sending Mail from an Internal LAN - Any Advice? [Solved]

Postby tweezer » 11. July 2012 15:04

Excruciatingly excellent!

One footnote:

I found that I do not necessarily need this in sendmail.ini:

force_sender=username@mydomain.com

You can leave that commented out and the emails have the correct sender address when coming from the application...

Cool stuff!!

T.
tweezer
 
Posts: 4
Joined: 11. July 2012 09:27
Operating System: Windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 91 guests