Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have Integrated Email in C# and Mail is Received In spam In gmail how can i resolve It .using go daddy

What I have tried:

public static string sendemail(string To, string message, string subject)
{
    try
    {
        MailMessage mail = new MailMessage();
        var smtpM = new SmtpClient();
        smtpM.EnableSsl = false;

        smtpM.Port = 25;

        smtpM.Host = "host.net";
        smtpM.Credentials = new NetworkCredential("mygmail.com", "paasword");

        string to = string.Join(",", To);
        mail.Bcc.Add(to);
        //mail.CC.Add(new MailAddress(txtcc.Text));
        mail.From = new MailAddress("host.com", "my - SYSTEMS");

        string html = message;
        mail.Body = html;
        mail.Subject = subject;
        mail.IsBodyHtml = true;

        smtpM.Send(mail);

        return "successfully Mail Sent";
    }
    catch (Exception ex)
    {
        return ex.ToString();
    }
}
Posted
Updated 16-Jun-17 20:49pm

1 solution

Simple: don't send mail that looks like spam.
Spam filters are pretty complex these days, and work by looking at the content of the message and determining if it's likely to be a genuine mail, or unsolicited advertising. (They also look at the source, subject, and suchlike, and use complicated heuristics to evaluate the whole message).

If GMail is deciding your messages are spam, the only things you can do are:

1) Contact GMail and ask them nicely not to.
2) Change your content so it doesn't look so much like advertising.

Option 1 may work - I've never needed to try - but option 2 is a lot more likely to help...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900