• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 455
  • Last Modified:

trouble sending email from 1.1 dot net on IIS win 2008

We are moving our older 1.1 aspx programs to a new IIS 7.0 win 2008 server.  Our emails no longer work for these programs.  Our 4.0 programs on the server work just find sending SMTP but the 1.1 programs that send via the same SMTP method do not work.  What do we need to add tot he server to make them work, does it work a differenent way.
0
kdeutsch
Asked:
kdeutsch
  • 7
  • 6
  • 2
1 Solution
 
ExpertHelp79Commented:
this will help you to get your answer and also perform the fix

http://forums.asp.net/t/1582128.aspx
0
 
kdeutschAuthor Commented:
ExpertHelp79:,

WE have 1.1 pages working fine, on 7.0.  The problem is that they used to send emails and now none of them do.  The code still works and the email goes out but it is not receveid by the email server, its like it disappears.
0
 
ExpertHelp79Commented:
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
RovastarCommented:
Using windows 2008 or windows 2008r2?
0
 
kdeutschAuthor Commented:
Rovastar:

using win 2008 service pack 2.

I added the SMTp server, set it up via the IIs 6.0 manager and then also went into the instructions for II7.0.  then made sure it was running and even restarted server but nothing is still working.  The program gets the emails and sends out the emails but the email server gets nothing.
0
 
RovastarCommented:
Ummh asp.net 1.1 should work with 2008 (not 2008r2 where it has been discounituned and not  supported and sometimes work)

Ok what method are you using for sending mail.

CDONTS doesnt work in IIS7 (another discontinued module) you need to use CDOSYS
0
 
ExpertHelp79Commented:
Try this
========================


1. start->administrative tools->server manager, go to features, select "add features", tick "smtp server" (if it is not already installed), choose to install the required "remote server admin toos"

2. check to confirm that "Simple Mail Transfer Protocol (SMTP)" service is running, if so, we are good to go.

3. start->administrative tools>internet info services(iis) 6.0

4. make sure that SMTP virtual server/default smtp server is running, if not, right click, then choose "start"

5. in IIS7,  go to website/virtual directory, double click "SMTP E-mail", Click on "Deliver e-mail to SMTP server", check the "Use localhost" checkmark


6.Your code should be LIKE:


            SmtpClient serv = new SmtpClient();
            MailMessage msg = new MailMessage();
            msg.To.Add("toadrr@domain.com);
            msg.Body = "body";
            msg.Subject = "subj";
            msg.BodyEncoding = System.Text.Encoding.ASCII;
            msg.IsBodyHtml = isHTML;
            serv.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
           serv.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["SmtpServerUserName"], ConfigurationManager.AppSettings["SmtpServerPassword"]);
             serv.Send(msg);
0
 
kdeutschAuthor Commented:
ExpertHelp79:

Ok all is running for SMTP mail.

However in IIs7.0 instead of locahost I have it set to an IP addredd to forward to.  Should I use locahost instead, how does it know where to send the mail.

Here is our 1.1 email  

sendmail

Public Shared Sub sendEmail(ByVal strTo As String, ByVal strFrom As String, ByVal strSubject As String, ByVal strBody As String, ByVal html As Boolean)
        Dim email As New MailMessage

        email.To = strTo
        email.From = strFrom
        email.Subject = strSubject

        If html = True Then
            email.BodyFormat = Mail.MailFormat.Html
        Else
            email.BodyFormat = Mail.MailFormat.Text
        End If

        email.Body = strBody
        SmtpMail.SmtpServer = "IP Address"

        Try
            SmtpMail.Send(email)
        Catch
        End Try
    End Sub
0
 
ExpertHelp79Commented:
how does it know where to send the mail.

This is the inbuilt operation of SMTP. Try to check the configuration of SMTP.. like relay..check the relay server.
0
 
ExpertHelp79Commented:
http://stackoverflow.com/questions/226655/setting-up-smtp-under-iis-7-on-windows-server-2008

Check this this talks about the same problem .. some issue related to permissions
0
 
kdeutschAuthor Commented:
ExpertHelp79:

I always assumed it sent it directly tot he SMtp server, I took out our IP address from there and just put in IP, Like I said it works fine for 1.1 on a win 2003 server with IIS6, and our Dot net 4.0 programs use it successfully on new web server, just the 1.1 stuff does nto work.  i will try the folder permissions and see what happens.
0
 
ExpertHelp79Commented:
Sure please let me know the result
0
 
kdeutschAuthor Commented:
ExpertHelp79:,

Thanks for all the help. The folder permissions issue is what solved it.
0
 
kdeutschAuthor Commented:
thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 7
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now