本文介绍了发送邮件到我的ZOHO帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,我已编写此代码,用于在新用户注册时发送邮件。但它没有奏效。请给出合适的解决方案。



Dear sir, I have written this code for send a mail while a new user register. But it has not worked. plz give mw the proper solution.

public void sendMail()
   {
       try
       {

           var sc = new SmtpClient

           {

               Host = "smtp.zoho.com",

               Port = 465,

               EnableSsl = true,

               Credentials = new System.Net.NetworkCredential("[email protected]", "-------")

           };

           var from = new MailAddress("[email protected]", "HELLO EMAIL SYSTEM");

           var to = new MailAddress("[email protected]");

           var m = new MailMessage(from, to) { Subject = txtComplaint.Text, Body = txtName.Text + txtContactNo.Text + txtMailId.Text };

           m.IsBodyHtml = false;

           sc.Send(m);

       }

       catch (Exception ex)
       {
           ex.Message.ToString();


       }
   }

推荐答案


这篇关于发送邮件到我的ZOHO帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 04:30