100% Australian Windows Web Hosting
  • Knowledge Base

Mail server (SMTP) to use in web site code 

Was this helpful? (12) (2)


Shared Web Hosting

Server: localhost
Username: leave blank
Password: leave blank

The Host/Server address to use when sending email through a web site, either in ASP, PHP, ASP.NET or Perl is "localhost". 

No username and password is required.



For VPS accounts you can either install a local SMTP Server to it or Contact Support for an alternative mail server to use.



The PHP mail() function will automatically use localhost to send mail by default, no further configuration should be required. CMS's (Content Management Systems) such as Wordpress and Joomla will be set to send mail through localhost by default. However if you are on a VPS without an installed SMTP server, please contact support StudioCoast Support.



If your website uses ASP.NET, the SMTP server to use when sending mail must be specified in the code. This may be as part of a code behind file or in the web.config file. If you are using a CMS (Content Management System) such as DotNetNuke or nopCommerce, the SMTP settings can be set in the CMS backend (refer to the CMS documentation).

If you need to set the SMTP server in the web.config, this needs to go inside the <system.net> tags. Below is a full example including the <configuration> tags:

     <smtp from="example@yourdomain.com">
      <network host="localhost" />

The network settings can be kept as simple as specifying the host name to be localhost. The port will always be the default (25) so doesn't need to be included. In addition, the username and password need to be kept blank so also are not required.

Do note the above is an example only. The above will be in a different format if located inside a code behind file. If you are unsure, refer to your web developer for clarification.

If you are on a VPS without an installed SMTP server, please contact support StudioCoast Support for the host value setting.


Last Updated:  24/05/2016 10:25 AM


Copyright © 2002 - 2021 StudioCoast Pty Ltd   |   ABN: 53 143 039 070