?
Solved

SMTP problems

Posted on 2007-10-04
3
Medium Priority
?
322 Views
Last Modified: 2008-01-14
i'm trying to send mail to email address outside of the domain and i'm using the System.Net.Mail objects (not system.web). at first, i just tried a straight up send using the address of my exchange server as the smtp host, but i got relay errors for any addresses that were outside the domain. so i found somewhere that i could use SmtpDeliveryMethod.PickupDirectoryFromIis to get around this problem, but then i got Cannot get IIS pickup directory. so i figured it was because my exchange server did not have the smtp in IIS (it's in exchange and it's separate). so i installed smtp on the web host and configured it with the proper permissions, but now the emails just don't get sent and i don't get any errors.

Dim objMail As New MailMessage()
        objMail.From = New MailAddress("address@internaldomain.com")
        objMail.To.Add("address@internaldomain.com")
        objMail.CC.Add("address@externaldomain.com")

        objMail.Subject = "This is an email"
        objMail.Body = "this is a sample body with html in it. <b>This is bold</b> <font color=#336699>This is blue</font>"
        objMail.IsBodyHtml = True

        Dim smtp As New SmtpClient("192.168.1.8") 'the localhost
        smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis
        smtp.Send(objMail)
0
Comment
Question by:craskin
  • 2
3 Comments
 
LVL 12

Author Comment

by:craskin
ID: 20015980
ah. i just found out that the external address did work, but the email to the internal one did not. that's even weirder. and now that the smtp is added to the localhost, when i switched the smtp server back to the exchange server, it delivered to the outside, but not the inside.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 20140446
Did you set up the internal SMTP to deliver mail anywhere?

Bob
0
 
LVL 12

Author Comment

by:craskin
ID: 20142254
no, do i setup an alias domain or a remote domain? right now, the local smtp just has

servername.domain.com Local (Default)
some long Guid.domain.com Local (Normal)

in the domain list.
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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question