Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

again i face one issue. Lot of time i am using mail function in my application. now it will get an error as :
Mailbox unavailable. The server response was: 5.7.1 Message rejected as spam by Content Filtering

my code for mail function is
C#
dt.OpenCon();
       string str = "SELECT MA_First_Name,MA_Email_Id FROM Master_Applicant WHERE Month(MA_DOB) = Month(CURRENT_TIMESTAMP) AND Day(MA_DOB) = Day(CURRENT_TIMESTAMP)";

       DataSet ds = dt.ExecuteDataSet(str);
       if (ds.Tables[0].Rows.Count > 0)
       {
           ViewState["Name"] = ds.Tables[0].Rows[0]["MA_First_Name"].ToString();
           ViewState["Email"] = ds.Tables[0].Rows[0]["MA_Email_Id"].ToString();

       }

       string name = ViewState["Name"].ToString();
       string email = ViewState["Email"].ToString();

       try
       {
           string ToEmailID = email.ToString();
           string Fromemail = "kgirish@elinktechnology.net";
           string copymail = "weblink@elinktechnology.net";
           string copymailto = "kgirish@elinktechnology.net";
           string tomailcc = "seema@elinktechnology.net";

           System.Net.Mail.MailMessage mess = new System.Net.Mail.MailMessage();
           mess.Subject = "Birthday Mail";
           mess.IsBodyHtml = true;
           mess.Body = "<table style='width:100%; font-family:Arial; color:Black; size:10px; text-align:left'>" +
           "<tr><td style='font-weight:bold'>" +
           "Happy Birthday,<br/><br/>" +
           "</td></tr>" +

           "<tr><td>" +
           "Wish You Many Many Happy Returns of the Day "+ ViewState["Name"].ToString() +" <br/><br />" +
           "</td></tr>" +
           "<p>" +
           "</p>" +
           "<tr><td> <a href='http://www.elinktechnologies.net/elm/'>Appraisal Form<td></tr>" +
           "<tr><td>" +
           "God Bless You..<br/><br/><br />" +
           "</td></tr>" +

           "<tr>" +
           "<td>" +
           "Regards," +
           "</td></tr>" +
           "<tr>" +
           "<td style='font-weight:bold'>" +
           "Elink Management Team" +
           "</td></tr>" +
           "</table>";

           mess.To.Add(ToEmailID);
           if ((copymailto.ToString() != string.Empty) && (copymailto.ToString() != null))
           {
               mess.To.Add(copymailto);
           }
           mess.From = new MailAddress(Fromemail);
           mess.CC.Add(tomailcc);
           if ((tomailcc.ToString() != string.Empty) && (tomailcc.ToString() != null))
           {
               mess.CC.Add(tomailcc);
           41}
           SmtpClient sc = new SmtpClient();
           sc.Host = "180.92.175.6";
           sc.Send(mess);

           ViewState["Email_sent"] = "Y";
           ViewState["Email_reason"] = "N";


       }
       catch(Exception ex)
       {
           ViewState["Email_Sent"] = "N";
           ViewState["Email_Reason"] = ex.Message;
       }
   }
Posted
Updated 22-Jul-15 4:33am
v2
Comments
[no name] 22-Jul-15 8:42am    
An SQL query is not a "mail function". And the error message means exactly what it says. You would need to ask the mail server why your message are being marked as spam. We can't tell you that.
Kornfeld Eliyahu Peter 22-Jul-15 8:43am    
'Message rejected as spam by Content Filtering'!!!
Check the content of your mail!!!
Member 11221185 22-Jul-15 8:57am    
this sql query used in mail function
dt.OpenCon();
string str = "SELECT MA_First_Name,MA_Email_Id FROM Master_Applicant WHERE Month(MA_DOB) = Month(CURRENT_TIMESTAMP) AND Day(MA_DOB) = Day(CURRENT_TIMESTAMP)";

DataSet ds = dt.ExecuteDataSet(str);
if (ds.Tables[0].Rows.Count > 0)
{
ViewState["Name"] = ds.Tables[0].Rows[0]["MA_First_Name"].ToString();
ViewState["Email"] = ds.Tables[0].Rows[0]["MA_Email_Id"].ToString();

}

string name = ViewState["Name"].ToString();
string email = ViewState["Email"].ToString();

try
{
string ToEmailID = email.ToString();
string Fromemail = "kgirish@elinktechnologies.net";
string copymail = "weblink@elinktechnologies.net";
string copymailto = "kgirish@elinktechnologies.net";
string tomailcc = "seema@elinktechnologies.net";

System.Net.Mail.MailMessage mess = new System.Net.Mail.MailMessage();
mess.Subject = "Birthday Mail";
mess.IsBodyHtml = true;
mess.Body = "<table style='width:100%; font-family:Arial; color:Black; size:10px; text-align:left'>" +
"<tr><td style='font-weight:bold'>" +
"Happy Birthday,<br/><br/>" +
"</td></tr>" +

"<tr><td>" +
"Wish You Many Many Happy Returns of the Day "+ ViewState["Name"].ToString() +" <br/><br />" +
"</td></tr>" +
"<p>" +
"</p>" +
"<tr><td> Appraisal Form<td></tr>" +
"<tr><td>" +
"God Bless You..<br/><br/><br />" +
"</td></tr>" +

"<tr>" +
"<td>" +
"Regards," +
"</td></tr>" +
"<tr>" +
"<td style='font-weight:bold'>" +
"Elink Management Team" +
"</td></tr>" +
"</table>";

mess.To.Add(ToEmailID);
if ((copymailto.ToString() != string.Empty) && (copymailto.ToString() != null))
{
mess.To.Add(copymailto);
}
mess.From = new MailAddress(Fromemail);
mess.CC.Add(tomailcc);
if ((tomailcc.ToString() != string.Empty) && (tomailcc.ToString() != null))
{
mess.CC.Add(tomailcc);
41}
SmtpClient sc = new SmtpClient();
sc.Host = "180.92.175.6";
sc.Send(mess);

ViewState["Email_sent"] = "Y";
ViewState["Email_reason"] = "N";


}
catch(Exception ex)
{
ViewState["Email_Sent"] = "N";
ViewState["Email_Reason"] = ex.Message;
}
}

this actualy my mail function

1 solution

You can't.
The error message:
CSS
Mailbox unavailable. The server response was: 5.7.1 Message rejected as spam by Content Filtering

Means just that: your message looks like spam and will not be accepted.

The only way to get it through is make your message look less like spam...and we can't help you there!
 
Share this answer
 
Comments
Member 11221185 23-Jul-15 5:17am    
Thanks to everyone..finally solve the problem.

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