Sending mail from c#.net -


i wrote code in c# send email perticular userid working fine local host

but today hosted in server after hosting email not sent "messaging sending failed" - error displaying code written

please give sugession

string msg = "welcome india"; mailmessage mm = new mailmessage("email_from@gmail.com", email_to@gmail.com, "subject", msg);  mm.isbodyhtml = false; smtpclient sc = new smtpclient("smtp.gmail.com",587); networkcredential nc = new networkcredential("email_from@gmail.com", "password"); sc.enablessl = true; sc.usedefaultcredentials = false; sc.credentials = nc; sc.send(mm); 

even if server not blocking connection, google might block application accessing server. i've tried same , got following email google:

amit,

someone tried use application sign in google account - xyz@gmail.com. prevented sign-in attempt in case hijacker trying access account. please review details of sign-in attempt:

monday, 4 february 2013 17:48:12 o'clock utc ip address: 108.163.248.10 location: united states

if not recognise sign-in attempt, else might trying access account. should sign in account , reset password immediately. find out how @ http://support.google.com/accounts?p=reset_pw

if you, , want give application access account, complete troubleshooting steps listed @ http://support.google.com/mail?p=client_login

note: email address cannot accept replies.

yours sincerely, google accounts team

i clicked on troubleshooting link , did directed , problem solved. should check if you've got similar email google.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -