WSS document event handler that will use System.web.mail sendmail

C

cindy

WSS document event handler that will use System.web.mail sendmail

I am not using vs studio 2.0 I have 1.1


I have a WSS document event handler that works on a document insert, I want
to use system.web.mail to get to sendmail and put out an email. Document
event handlers are written with C# class library which does not allow me to
reference system.web.mail. I use use the interface with a web control and
reference the web control from within the document event class but when I
compile I get

c:\Documents and Settings\cmello\My Documents\Visual Studio
Projects\SISWorkflow\bin\Debug\SendMailCtrl.dll Referenced class
'SendMailCtrl.DocLibSendMail' has base class or interface
'System.Web.UI.WebControls.WebControl' defined in an assembly that is not
referenced. You must add a reference to assembly 'System.Web'.

I am thinking that is because in the SendMailCtrl dll there is a method that
uses SendMail and the reference to System.web.mail inside the web control
project is the reason that I cannot create a new instance of the web control
object in my C# document event library and call the method to send mail.

Help!! please I need to have a document library insert event send my custom
email to users who have alerts set without having to go into CAML and rewrite
the alert notification AARGH
 
L

Luke Zhang [MSFT]

Hello,

I are not very clear on what you said about:

Document event handlers are written with C# class library which does not
allow me to reference system.web.mail.

Even in a class library project, we can still add a reference to
System.Web.Dll and use System.Web.Mail.MailMessage. For example, you can
open the class library project in VS.NET 2003, right click the project in
solution explorer and select "add reference" and add "System.Web.DLL".
Then, in its code, you can use:

System.Web.Mail.MailMessage m= new System.Web.Mail.MailMessage();

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top