8

i want to send mail to user when registered but error (The SMTP host was not specified) how to i configure smtp in web.config?

Farhood
  • 197
  • 3
  • 5
  • 9

1 Answers1

24

You should add following in web.config file:

<system.net>
    <mailSettings>
        <smtp>
            <network host="smtp.xxx.com" password="" userName=""/>
        </smtp>
    </mailSettings>
</system.net> 
  • what is UserName? for example I have an email info@site.com. [info] is UserName? or [info@site.com] ? – AmirHossein Jan 30 '13 at 21:03
  • @AmirHossein No UserName and password are for using the SMTP server. This is often not required, but sometimes an SMTP server requires a UserName and Password. – Holger Mar 18 '13 at 16:40