Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i am tried to send an email using smtp in .net mvc with pdf attachment (in memory attachment), its working on local host but when we deplyed on IIS server geting the following exception.

system.net.mail.smptp exception 'failure sending mail'

What I have tried:

http://stackoverflow.com/questions/279953/how-to-send-an-email-with-attachments-using-smtpclient-sendasync

http://stackoverflow.com/questions/15017132/how-to-send-email-with-attachment-in-asp-net
Posted
Updated 6-Apr-17 21:15pm

1 solution

Hi,

First the SMTP server should be accessible from the hosted server.

Type below command after opening CMD in administrator mode from hosted server

Telnet [SMTP Server IP / Name] [Port]

if its not accessible then as your infra guy to do the needful.
 
Share this answer
 
Comments
Member 10484162 7-Apr-17 5:39am    
thanks for your response, i try the following command and its sending a response but still i am not able to sent an email with attachment. Thanks
Suvabrata Roy 7-Apr-17 6:21am    
So you have connectivity with the SMTP server ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900