This project has moved. For the latest updates, please go here.

Email Settings over Production Server

Feb 27, 2012 at 10:47 AM

Hi ,

We have tested Ticket Desk(TicketDesk MVC 2.0.1 binaries) in localhost with gmail settings and it was working fine.

Then we have hosted the same into Production server with my production server smtp details as follows.

<smtp deliveryMethod="Network">
        <network host="mysmtp" port="25" defaultCredentials="true"/>

and Admin settings are:

Site Root Url For Email:  http://ProductionServerIP.

From Email Address:

But Email functionality is not working. Do I need to change any other settings specific to Production Server.

Can you please let me know if any changes required for admin settings/web.config file.

Thanks and Regards


Feb 27, 2012 at 8:28 PM

That looks about right to me. Of course, the production settings depend on how the production environment is setup, but what you are showing is a pretty standard SMTP setup.

In general, when having SMTP issues, I recommend creating the most simple web application you can that sends an email... basically a test aspx page with just enough code to send a hard-coded message over SMTP, and a web.config with the SMTP settings. Confirm the settings and emails work in the simplest situation possible, then work from there.  

Feb 28, 2012 at 9:02 AM

Yes Stephen,

I have created sample application and executed in server.

          string from = "";
            string to = "";
            string subject = "Test Mail";
            string body="Test body";
            SmtpMail.SmtpServer = "smtpserverName";
            SmtpMail.Send(from, to, subject, body);

Its working fine.  Then What else need to change in config file of Ticket Desk.

Please share with me if you have any work around.



Feb 28, 2012 at 4:27 PM

Sorry, I just don't have enough information to offer a work around.

TicketDesk doesn't do anything unusual in how it sends email. It uses System.Net.Mail in a fairly simplistic way. 

In your test code, you appear to be using System.Web.Mail, which is an older mail library. TicketDesk uses the newer System.Net.Mail namespace instead.  Also, when testing, you want to make your test app rely on the web.config file for the settings instead of supplying them explicitly in the code.

Something like this:

using System.Net.Mail;

public void MyTest()
	SmtpClient client = new SmtpClient();

	MailAddress fromAddr = new MailAddress("", "tester");

	MailAddress toAddr = new MailAddress("", "person name");

	MailMessage msg = new MailMessage(fromAddr, toAddr);
	msg.Subject = "testing something";

	msg.Body = "some text body (plain text)";  

	//relies on the web.config for the SMTP server, port, and related settings.

I can't test this (having a problem with my developer laptop atm), but the code above is a hacked up version of what's in the DefaultSmtpEmailHandlerService in TicketDesk. If you can make this work with settings from web.config, then you'll have confirmed the configuration you need for ticketdesk. Otherwise, TicketDesk's other email related settings are all available from the on-screen admin tools.