SG Windows IT Pro Group

Where Windows IT Professionals in Singapore meet together...
Welcome to SG Windows IT Pro Group Sign in | Join | Help
in Search
Microsoft's Newsletters: TechNet Flash & Security News Letter
Some other Singapore User Groups: MessagingTalk | SGDotNet

SWUG is revamping
SWUG is revamping our services and streamlining our operations with TechNet for a single voice. If you wnat to join our mailing list, please drop an email to admin@sgwinowsgroup.org
Latest post 05-25-2009 2:32 PM by Desmond Kung. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-25-2009 1:52 PM

    • James
    • Top 50 Contributor
    • Joined on 10-28-2008
    • Posts 23

    ASPNET SendMail through SSL enabled mail server

    Hi,

    I have a problem sending e-mail messages through a SSL enabled mail server in ASPNET 2.0. I get a 'The operation has timed out' error when my program code try to send out an e-mail message.

    This is what I coded in my Web.config file for the mail settings section but there is no option for me to specify the mail server as SSL-enabled in this mail setting tags

    <system.net>

    <mailSettings>

       <smtp from="xxxxxx" >

         <network host="yyyy" port="999" userName="xxxxxx" password="pppppp" defaultCredentials="true" />

      </smtp>

    </mailSettings>

    </system.net>

    where xxxxxx = my e-mail address, yyyy = my SSL-enabled mail server name, 999= my mail server port number,  pppppp = my e-mail password.

    I am using NET 2.0 and Visual Studio 2008 in developing the mail application. How do I configure the mail settings for SSL-enabled mail server in my web config file and the C# coding to send out e-mail through a SSL-enabled mail server?

    I hope someone could help me out. Thanks.

     

    James

     

     

     

     

     

     

     

     

     

    <

    Filed under: ,
  • 05-25-2009 2:09 PM In reply to

    Re: ASPNET SendMail through SSL enabled mail server

    Hi James,

    You might want to try SGDOTNET.

    Cheers.

  • 05-25-2009 2:32 PM In reply to

    Re: ASPNET SendMail through SSL enabled mail server

    I dunno if this helps, but I got a tiny site up that uses your settings here: http://www.taikyuu.com.sg/contact.aspx

    Here's my staged settings:

    <?xml version="1.0"?>

    <!--
        A full list of settings and comments can be found in
        machine.config.comments usually located in
        \Windows\Microsoft.Net\Framework\v2.x\Config
    -->
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

        <appSettings>
         <add key="EmailTo" value="sales [at] blahblahblah.com.sg" />
         <add key="EmailSubject" value="Customer Enquiry / Request For Information" />
        </appSettings>
       
        <system.net>
         <mailSettings>
          <smtp>
           <network host="mailmx.blahblahblah.com.sg" defaultCredentials="false" />
       </smtp>
      </mailSettings>
     </system.net>
     
        <system.web>
         <!-- Set default masterpage -->
         <pages masterPageFile="~/Default.master" />

            <!--
                Set compilation debug="true" to insert debugging
                symbols into the compiled page. Because this
                affects performance, set this value to true only
                during development.
            -->
            <compilation debug="false"/>

            <!--
                The <authentication> section enables configuration
                of the security authentication mode used by
                ASP.NET to identify an incoming user.
            -->
            <authentication mode="None"/>

            <!--
                The <customErrors> section enables configuration
                of what to do if/when an unhandled error occurs
                during the execution of a request. Specifically,
                it enables developers to configure html error pages
                to be displayed in place of a error stack trace.

            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm"/>
                <error statusCode="404" redirect="FileNotFound.htm"/>
            </customErrors>
            -->
        </system.web>
       
    </configuration>

Page 1 of 1 (3 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems