Antonio Di Girolamo
Antonio Di Girolamo

Reputation: 73

Send email from c#

I installed on a server windows server 2008 service SmarterMail. Configured interface and works perfectly. I created a software in .net c # here's the code:

           MailMessage mail = new MailMessage();
            mail.From = new MailAddress("[email protected]", "Prova");
            foreach (string recips in email)
            {
                mail.To.Add(recips);
            }
            mail.Subject = "PRova";
            mail.BodyEncoding = System.Text.Encoding.UTF8;
            mail.IsBodyHtml = true;
            mail.Body = messaggio;
            foreach (string itemurl in file)
            {
                System.Net.Mail.Attachment attachment;
                attachment = new System.Net.Mail.Attachment(itemurl);
                mail.Attachments.Add(attachment);
            }
            SmtpClient smtp = new SmtpClient(server);
            smtp.UseDefaultCredentials = false;
            smtp.Credentials = new NetworkCredential("prova", "prova");
            smtp.Send(mail);

The problem is when I send email to an address @ gmail.com. The emails come in all domains except for gmail. What can be the reason?

Upvotes: 2

Views: 270

Answers (2)

sleath
sleath

Reputation: 871

If the email works in all domains accept gmail. I would check if you have been black listed by gmail.

This doesn't seem like a issue with code.

That message tells you that you've basically have been blocked. I'd suggest not to focus on your code but to focus on what google's response is to you being blocked.

Upvotes: 3

Antonio Di Girolamo
Antonio Di Girolamo

Reputation: 73

This is the response of google server....

[2015.05.20] 16:43:03 [11057] RSP: 354 Go ahead r1si4209019wic.9 - gsmtp [2015.05.20] 16:43:03 [11057] RSP: 421-4.7.0 [ 15] Our system has detected an unusual rate of [2015.05.20] 16:43:03 [11057] RSP: 421-4.7.0 unsolicited mail originating from your IP address. To protect our [2015.05.20] 16:43:03 [11057] RSP: 421-4.7.0 users from spam, mail sent from your IP address has been temporarily [2015.05.20] 16:43:03 [11057] RSP: 421-4.7.0 rate limited. Please visit [2015.05.20] 16:43:03 [11057] RSP: 421-4.7.0 http://www.google.com/mail/help/bulk_mail.html to review our Bulk [2015.05.20] 16:43:03 [11057] RSP: 421 4.7.0 Email Senders Guidelines. r1si4209019wic.9 - gsmtp

Upvotes: 0

Related Questions