Solved

SMTP Sink with VB.NET

Posted on 2004-08-08
14
822 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
14 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Clone Visual studio 2013 solution 5 24
Close word object 13 38
Populating an array of locale_time_info 8 37
Get Top Visible Row of Datagridview 6 27
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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now