c# - Email sending from 1and1 SMTP server -
trying send email 1and1 smtp server in asp :
mailmessage msg = new mailmessage(); msg.from = new mailaddress("admin@mywebsite.com"); msg.to.add("personalmail"); smtpclient smtp = new smtpclient("auth.smtp.1and1.fr",465); smtp.credentials = new networkcredential("admin@mywebsite.com", "mypassword"); smtp.enablessl = true; try { // smtp.send(msg); smtp.send(msg); return "ok"; } catch (exception e) { return e.tostring(); }
the code goes in catch error called :"net_io_connectionclosed" know problem ? regards
hyrozen,
you have use port 587.
Comments
Post a Comment