-1

ERROR: Service not available, closing transmission channel. The server response was: Resources temporarily unavailable - Please try again later

private void button1_Click(object sender, EventArgs e)
{
    string smtpAddress = "smtp.mail.yahoo.com";
    int portNumber = 587;
    bool enableSSL = true;

    string emailFrom = "mail@yahoo.com";
    string password = "mailpass";
    string emailTo = "sendemail@yahoo.com";
    string subject = "Hello";
    string body = "Hello, I'm just writing this to say Hi!";

    using (MailMessage mail = new MailMessage())
    {
        mail.From = new MailAddress(emailFrom);
        mail.To.Add(emailTo);
        mail.Subject = subject;
        mail.Body = body;
        //mail.IsBodyHtml = true;
        // Can set to false, if you are sending pure text.

        // mail.Attachments.Add(new Attachment("C:\\SomeFile.txt"));
        //mail.Attachments.Add(new Attachment("C:\\SomeZip.zip"));

        using (SmtpClient smtp = new SmtpClient(smtpAddress, portNumber))
        {
            smtp.Credentials = new NetworkCredential(emailFrom, password);
            smtp.EnableSsl = enableSSL;
            smtp.Send(mail);

        }
    }
}

What should I do?

CDspace
  • 2,639
  • 18
  • 30
  • 36
  • 1
    https://help.yahoo.com/kb/resources-temporarily---numeric-code-sln5083.html like the message says, why not queue the requests and try again later – Luke Hutton Aug 14 '17 at 21:10
  • yes, he allow you to do that, i do that some months ago and it work, but i lost the code – Andrei Niţă Aug 14 '17 at 21:12

1 Answers1

-1

You need to make sure an external application has permission to send emails through your email before you can proceed.

Devin L.
  • 437
  • 2
  • 12