c# - Sending emails (Gmail) -


this code worked few weeks ago, when try doesn't work. here's code:

        smtpclient client = new smtpclient();         client.port = 587;         client.host = "smtp.gmail.com";         client.enablessl = true;         client.timeout = 10000;         client.deliverymethod = smtpdeliverymethod.network;         client.usedefaultcredentials = false;         client.credentials = new system.net.networkcredential("mail@gmail.com", "password");          mailmessage mail = new mailmessage("mail@domain.com", "mail2@gmail.com", "subject", "body");         mail.bodyencoding = utf8encoding.utf8;         mail.deliverynotificationoptions = deliverynotificationoptions.onfailure;          client.send(mail); 

error is: smtpexception unhandled: unhandled exception of type 'system.net.mail.smtpexception' occurred in system.dll

additional information: operation has timed out.


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -