Link to home
Start Free TrialLog in
Avatar of ffayyca1
ffayyca1

asked on

How do I setup IIS 7 to send email

I'm developing a asp.net MVC app that sends email for user registration, but I can't get IIS to send email. When I tested my code, it returns a "failure sending email". Here is what I have done so far
1. Installed SMTP tool in IIS 7 and make sure the service is running.
2. Created a test email and put it in inetpub\mailroot\pickup and the mail is sent and received fine.
3. I'm not sure what settings I should use in IIS. Should I use "localhost" as the smtp server and port 25? Under what circumstance do I have to use authentication?

Avatar of QuinnDester
QuinnDester
Flag of United Kingdom of Great Britain and Northern Ireland image

IIS7 needs extra parameters to be declared before it will work.. these following are what you need to declare in your code that were not needed in IIS6 these are in ASP Classic

objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="localhost"

'Server port
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
objMail.Configuration.Fields.Update
Installed the IIS6 management compatibility from Roles and then go to administrative tools, IIS6 manager and configure SMTP server.

.

ASKER CERTIFIED SOLUTION
Avatar of ffayyca1
ffayyca1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ffayyca1
ffayyca1

ASKER

Found out solution on my own.