ASP.NET how to write code for mail sender? -


i have search many sites. can't understatnd said. refer in internet told create cdo files.

please me send mail in project. have 3 textboxes:

  1. tomail
  2. heading
  3. content of message
  4. send button

use below code sent mail.

            mailmessage mail = new mailmessage();             smtpclient smtpserver = new smtpclient("smtp.gmail.com");              mail.from = new mailaddress("me@mydomain.com");             mail.to.add("u@urdomain.com,rkrishtring@gmail.com");             mail.subject = "report";             mail.body = "this stack overflow using report";             attachment attachment = new attachment(filename);             mail.attachments.add(attachment);              smtpserver.port = 25;             smtpserver.credentials = new system.net.networkcredential("username", "password");             smtpserver.enablessl = true;              smtpserver.send(mail); 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -