Mohammed Ismail
Mohammed Ismail

Reputation: 15

SMTP shows success, but email never is delivered

My code work correctly with gmail domains but if I send any mail to anothet domain it show for me that the proccess seccessed but the mail don't receive any thing even junk mail.

public void send()
{
    MimeMessage message = new MimeMessage();

    MailboxAddress from = new MailboxAddress("Admin", "[email protected]");
    message.From.Add(from);

    MailboxAddress to = new MailboxAddress("User","[email protected]");
    MailboxAddress too = new MailboxAddress("User23","[email protected]");
    message.To.Add(to);
    message.To.Add(too);

    message.Subject = "This is email subject";

    message.Body=new TextPart("plain"){
        Text="Hello"
    };

    using(var cli=new SmtpClient())
    {
        cli.Connect("smtp.gmail.com", 465, true);
        cli.Authenticate("[email protected]", "password");
        cli.Send(message);
        cli.Disconnect(true);
    }

Upvotes: 0

Views: 870

Answers (1)

jstedfast
jstedfast

Reputation: 38618

Most likely the email message is being delivered, it's just being filtered as spam at the destination mailbox.

Upvotes: 1

Related Questions