System.Web.Mail

S

SJR3t2

I have re-installed .NET 1.1 and SP1 on multiple computers, one with
Win XP Pro and another with Win 2003, and I can't seem to get the
System.Web.Mail namespace and SmptMail and MailMessage classes. What
do I need to do to access this namespace along with the classes?

Steven
 
L

Lau Lei Cheong

Note that if that's not an ASP.NET project, you have to explicitly add
reference of System.Web namespace to the project in order to access it.
 
S

SJR3t2

Thanks Lau Lei Cheong, I can now compile. But I get this error.

Unhandled Exception: System.Web.HttpException: Could not access
'CDO.Message' object. ---> System.Reflection.TargetInvocationException:
Exception has been throw
n by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x8004020E): The server
rejected the sender address. The server response was
: 530 5.7.0 Must issue a STARTTLS command first d12sm3899146qbc

--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers,
Int32 culture, String[]
namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags
invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifier[] modifiers, CultureI
nfo culture, String[] namedParameters)
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj,
String methodName, Object[] args)
--- End of inner exception stack trace ---
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj,
String methodName, Object[] args)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)
at RetzNest.EMail.Main(String[] args) in d:\sjr3t2\visual studio
projects\test\email\email.cs:line 25

Any suggestions?
 
L

Lau Lei Cheong

A 530 error means that your email server requires authentication.

See the URL provided by Juan for how to add username and password to the
MailMessage with Fields.
 

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

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top