System.Web.Mail

  • Thread starter Thread starter SJR3t2
  • Start date Start date
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
 
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.
 
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?
 
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.
 
Back
Top