System.Runtime.InteropServices.comException (0x8004020f): The Server Rejected One or More Recipient Addresses.

xiaoxiao2021-03-06  65

this problem

Required settings can be used by specifying the mail server for the IP address

SMTP-> Properties-> Access-> relay

Add the ip address

Public Bool Send (String to, String from, String Subject, String Message)

{

Try

{

MailMessage EM = New MailMessage ();

Em.to = TO;

Em.from = from;

Em.subject = Subject;

Em.body = message;

// Found Out How To Send Authenticated Email Via System.Web.mail At http://systemwebmail.com (Fact 3.8)

IF (this.username! = null& this.password! = null)

{

Em.fields.add ("http://schemas.microsoft.com/cdpo/configuration/smtpauthenticate", "1"); // Basic Authentication

Em.fields.add ("http://schemas.microsoft.com/cdpo/configuration/sendusername", this.username); // set your username here

Em.fields.add ("http://schemas.microsoft.com/cdo/configuration/sendpassword", this.password); // set your password here

}

SMTPMAIL.SMTPSERVER = this.smtpserver;

SMTPMAIL.SEND (EM);

Return True;

}

Catch

{

Return False;

}

}

}

}

转载请注明原文地址:https://www.9cbs.com/read-85821.html

New Post(0)