error sending smtp mail

Z

z f

Hi,

i'm sending mail from the aspx page on the server.
it is running on hosting,
so i configure the System.Web.Mail.SmtpMail.SmtpServer property to my mail
server.
but problem is that sender email is also configurable and since the sender
email is not from the SMTP server same host, it is not allows to send.
i need to ba able to configure the SMTP Auth to be authenticated to
different user from the sender email, but i didn't find methods for that in
the object.
what should be the way?

might i be able to use the MailMessage Headers property for that?

The Error
The server rejected one or more recipient addresses. The server response
was: 550 You must check your mail from this IP or SMTP Auth before sending
to (e-mail address removed)


TIA, z.
 
S

Scott Allen

With the 1.1 framework SmtpMail does support authentication, but it's
well hidden and in my opinion rather obfuscated because the rest of
SmtpMail provides such a nice abstraction.

You need to use the fields property of the MailMessage object, as in:

mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",1);

(The value of 1 means "basic authentication", a value of 2 means NTLM)

Official but sparse documentation is at the following link:
http://msdn.microsoft.com/library/d.../cdosys/html/_cdosys_schema_configuration.asp

A complete example is here:
http://www.codeproject.com/dotnet/SystemWeb_Mail_SMTP_AUTH.asp
 
Z

z. f.

indeed it worked.
do you know if there is a possibility of controlling the encoding of the
user name / password to base 64 / clear text i couldn't understand from the
docs.

thnx!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top