Send Email using smtp C#

public void SendEmail(string smtpClient_add, int port_no, string username, string password, string fromEmail, string fromname, string Email_subject, string Email_body, string toEmail, string ccEmail, string pathToAttachment)
    {
        MailMessage mail = new MailMessage();
        SmtpClient SmtpServer = new SmtpClient(smtpClient_add);

        mail.From = new MailAddress(fromEmail, fromname);
        mail.To.Add(toEmail);
		if (ccEmail != "")
        mail.CC.Add(ccEmail);
        mail.Subject = Email_subject;
        mail.Body = Email_body;
        mail.IsBodyHtml = true;
        if (pathToAttachment != "")
            mail.Attachments.Add(new Attachment(pathToAttachment));
        SmtpServer.Port = port_no;
        SmtpServer.Credentials = new System.Net.NetworkCredential(username, password);
        SmtpServer.EnableSsl = true;
        SmtpServer.Send(mail);
    }