SMTP newsletter sending issue

Discussion in 'ASP.NET 2.0' started by sbramall, Apr 20, 2008.

  1. Hi, can anyone help

    I'm building an asp,net 2.0 application based on the VB version of the BeerHouse project called hosted by dasp. I'm working on the newsletter module at the moment and have now got it to send the email newsletter using smtp.mydomain.com which works well if my test users have an email account in the form [email protected]. However, for the users with a different email domain (such as [email protected]), nothing comes through. below is part of my config sys file (i've just shown the smtp/email bits). Am i doing something wrong?? Any idea- feedback most welcome.


    <configuration>
    <!--<configuration xmlns='http://schemas.microsoft.com/.NetConfiguration/v2.0'>-->
    <configSections>
    <section name='mydomain' type='MB.mydomain.mydomainSection, __code'/>
    ...

    <mydomain defaultConnectionStringName='mydomaincs'>
    <contactForm mailTo='steve@mydomaincom'/>
    <articles pageSize='10'/>
    <polls archiveIsPublic='true' votingLockByIP='false'/>
    <newsletters fromEmail='[email protected]' fromDisplayName='mydomain' archiveIsPublic='true' hideFromArchiveInterval='10'/>
    <forums threadsPageSize='8' hotThreadPosts='10' bronzePosterPosts='10' silverPosterPosts='20' goldPosterPosts='50'/>
    <store sandboxMode='true' businessEmail='[email protected]'/>
    </mydomain>


    ...


    <system.net>
    <mailSettings>
    <smtp deliveryMethod='Network' from='[email protected]'>
    <network defaultCredentials='true' host='smtp.mydomain.com' password='mypassword' port='587' userName='[email protected]'/>
    </smtp>
    </mailSettings>

    ...

    So far everything I have worked on works - i have not modified any of the orgiinal except to change the namespace from beerhouse to mydomain..


    I have just got this for 7 or 8 test users and the email confirmation of membership works fine as does the pssword recovery and change system. All email accounts in my test users are valid and current.

    Any help gratefully received.

    many thanks in anticipation.

    steve
     
  2. You need to use localhost as the host for config sections with ASP.NET, and even Classic ASP forums.
    I haven't messed with the beerhouse kit but I am a big fan of the related ASP.NET 2.0 book by Stephen Walther.
    Salute,
    Mark
     
  3. Thanks for the swift reply mark

    I've changed the host to localhost and taken out the credentials and now it does not send any emails at all. Any ideas????


    <Mydomain defaultConnectionStringName='MyCS'>
    <contactForm mailTo='[email protected]'/>
    <articles pageSize='10'/>
    <polls archiveIsPublic='true' votingLockByIP='false'/>
    <newsletters fromEmail='[email protected]' fromDisplayName='Mydomain' archiveIsPublic='true' hideFromArchiveInterval='10'/>





    <mailSettings>
    <smtp deliveryMethod='Network' from='[email protected]'>

    <network defaultCredentials='true' host='localhost' password='' port='' userName=''/>
    </smtp>
    </mailSettings>
    </system.net>
     
  4. Joseph Jun

    Joseph Jun DiscountASP.NET Staff

    You currently have an empty string for the port value and I'm not sure if that defaults your application to use port 25. Could you try explicitly setting the port to 25 by using port='25' to see if you're able to send a message?

    I was wondering as well, are you receiving any type of error message at all?

    Winston

    DiscountASP.NET
     
  5. [​IMG]Ahhh, sometimes the simplest of things turns into the most powerful of answers. Putting back the port 25 seems to have solved it. Web app now sending newsletters perfectly. Thanks for the help, much appreciated.


    Steve
     

Share This Page