?
Solved

SMTP Sink with VB.NET

Posted on 2004-08-08
14
Medium Priority
?
1,107 Views
Last Modified: 2010-05-18
Can anyone please tell me how to implement an SMTP Sink using VB.NET. This was very easy in VB6 using the code below. I desperately need a working example to complete my Anti-Spam Engine. In VB6 I just set a Reference to the CDO For Windows 2000 and SEO, Use the code below and Register the Sink. I cannot work out how to do this in VB.NET. It is not as easy just using the exisiting COM Objects - I have tried.

Option Explicit

Implements CDO.ISMTPOnArrival
Implements IEventIsCacheable

Private Sub IEventIsCacheable_IsCacheable()
    ' Just returns S_OK.
End Sub

Private Sub ISMTPOnArrival_OnArrival(ByVal Msg As CDO.IMessage, EventStatus As CDO.CdoEventStatus)

    ' Process Message HERE

End Sub
0
Comment
Question by:BGillham
  • 6
  • 2
  • 2
10 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11749376
its a bit more complex ....

http://www.microsoft.com/downloads/details.aspx?FamilyId=0CD7F344-CAD6-416E-9BC1-0D7C214E1D0B&displaylang=en has the official MS examples.
http://www.codeproject.com/csharp/CsManagedEventSinksHooks.asp is an article on the subject using C# but should be very easily ported.
0
 
LVL 3

Author Comment

by:BGillham
ID: 11749414
I am fairly new to the .NET Platform and I have seen these examples. They are in C# and I do not know how to port these applications. I need a working sample in VB.NET.
0
 
LVL 3

Author Comment

by:BGillham
ID: 11756442
I will gladly give a 1000 points to get a solution to this question!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11756460
im looking for a predone one ... I work mainly in C# ... out of curiosity have you tried running a C#->VB.NET converter over the samples ?

0
 
LVL 3

Author Comment

by:BGillham
ID: 11756541
Been there, done that :-(
0
 
LVL 3

Expert Comment

by:Scoobyed
ID: 11762128
I've previosuly used some decent c# to vb.net just to see how to get some things going (albeit not on this smtp stuff)
http://authors.aspalliance.com/aldotnet/examples/translate.aspx
0
 
LVL 3

Author Comment

by:BGillham
ID: 11768379
I would also entertain a C# Solution that call a VB.NET Boolean Function that tells the Sink to either Abort or Deliver the Message.

EG:

If VBNET.Spam then
    Abort
else
    Deliver
End If

C# Code as I know it - I suck at this

if (VBAssembly.IsSpam==true)
{
    // Abort delivery of this message
}
else
{
    Delivery can proceed
{
0
 
LVL 3

Accepted Solution

by:
Scoobyed earned 2000 total points
ID: 11781760
0
 
LVL 3

Author Comment

by:BGillham
ID: 12146759
Why is this question marked PAQ???????
Does "DarthMod" HONESTLY think that this question has been answered even in part?
While Scoobyed has made an honest attempt to answer the question he has added nothing new to what I already know. I KNOW how to do this in VB6. The question is VERY specific - Do it in DOTNET. If points are going to get awarded for these type of answers then take all my points because this Forum has become lame and I will not return. To prove my point take look at ALL my previously asked questions and with the exception of ONE they have ALL gone UNANSWERED. This Forum is NOT a good resource for serious programmers.
0
 
LVL 3

Author Comment

by:BGillham
ID: 12146961
What a lame response. The next person who has a similar request is going to pay good points for a NONE-ANSWER. I do not intend to be rude but this question should have deleted after 21 days NOT PAQed. It makes no difference to me because this site has been of no value to me whatsoever. There many other resources which have less red tape more technical know-how. This site may be great for beginners but it is of no value for developers with serious questions. I doubt if i will be back except if I am trying some new technology and need only beginner examples.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question