Virtual Host with SMTP setting
Posted by: mezia (---.pool1.unallocated-110-128.orangehomedsl.co.uk)
Date: January 01, 2010 09:12PM

Hello!

I am running my website on wamp server with Zone Edit DNS and its working good. I am trying to create a subdomain inside virtual host but I didn't find any hint. Now I am using Virtual Host it self for subdomain but I don't know the SMTP setting in httpd.conf. If I don't use Virtual Host then SMTP work without any trouble.

Can anyone please tell me how to configure SMTP in Virtual Host and If anyone guide me how to add Aliases (subdomain) in Virtual Host with SMTP for all subdomains and main folder I will very thank full for that.

This is my setting and its working ok with SMTP
Listen 80
ServerName *:80
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot c:/wwwroot/
ServerName www.domain.com
</VirtualHost>


<VirtualHost *:80>
DocumentRoot c:/wwwroot/subdomain
ServerName subdomain.domain.com
</VirtualHost>

thanks

Options: ReplyQuote
Re: Virtual Host with SMTP setting
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: January 02, 2010 12:03PM

BY SMTP do you mean PHP's SMTP setting? If you that is what you're referring to then you can do

<VirtualHost *:80>
DocumentRoot c:/wwwroot/subdomain
ServerName subdomain.domain.com
php_value SMTP smtp.otherdomain.com
</VirtualHost> 

Options: ReplyQuote
Re: Virtual Host with SMTP setting
Posted by: mezia (---.pool1.unallocated-110-128.orangehomedsl.co.uk)
Date: January 02, 2010 12:56PM

I configured smtp.gmail.com with my computer SMTP and in my PHP.ini I set SMTP = localhost and port 25. I am working in Virtual Host environment because I want sub domains as well. If I work in normal mode without Virtual Host then SMTP work fine but when I work in VH environment then SMTP don't work.

I tried your settings in this way

<VirtualHost *:80>
DocumentRoot c:/wwwroot/
ServerName www.domain.com
DirectoryIndex index.html index.php index.php3
php_value SMTP localhost
ErrorLog c:/wamp/logs/apache_error.log
</VirtualHost>

but still have facing this following error but nothing found in apache error log

The e-email could not be sent
Possible reason: your host may have disabled the mail() function

Options: ReplyQuote
Re: Virtual Host with SMTP setting
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: January 02, 2010 02:00PM

Do note that mail() does not work with servers that require authorisation such as Gmail.

Also WAMP does not come with a mail server so you wont be able to send emails using localhost as the mail server.

Options: ReplyQuote
Re: Virtual Host with SMTP setting
Posted by: mezia (---.pool1.unallocated-110-128.orangehomedsl.co.uk)
Date: January 02, 2010 04:20PM

I know WAMP does not come with a mail server but if I don't use Virtual Host then I can send email through WAMP which use Gmail address (IIS SMTP) without any trouble but when I use Virtual Host then localhost SMTP or email doesn't work. I need to use VH that's why I am worry about localhost SMTP in VH.

This is my setting in PHP.ini and it work great if i don't use Virtual Host and my IIS SMTP is configured with smtp.gmail.com

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = admin@localhost

Options: ReplyQuote
Re: Virtual Host with SMTP setting
Posted by: yfastud (Moderator)
Date: January 03, 2010 03:12AM


Options: ReplyQuote
Re: Virtual Host with SMTP setting
Posted by: mezia (---.pool1.unallocated-110-128.orangehomedsl.co.uk)
Date: January 07, 2010 02:55AM

Please follow this link [forum.wampserver.com] I am looking for SMTP with Virtual Host working solution.

Options: ReplyQuote


Sorry, only registered users may post in this forum.