Hi Guys,
I have been searching for a solution for a while but haven't made any headway, if anyone could give me any ideas I would be extremely grateful.
The scenario is that I have been using CDOSYS to send automated emails from a number of Intranet pages within my organisation. Everything worked fine until a month or so ago, when we installed a new servicepack to our email system - Novell Groupwise.
Since the upgrade, automatic emails intermittently fail, with the error:
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
/nmdb/checkform.asp, line 41
Line 41 is the Line "cdoMessage.Send"
After much experimentation, I found that, because I am sending the message directly to the smtp server and bypassing the mail sweeper, the smtp server assumes that the mail should come from an external domain - if it does not come from an external domain, the email is blocked. I suppose this makes sense because it means that I cant create an email saying that everyone has had a pay rise and pretend that it came from the MD!!!
Unfortunately, some emails are still failing for no apparaent reason. To combat this I have created a VB6 dll to re-send the email if it fails, the code within the dll is:
I have registered the dll on the server and I can call the doSend function from my asp pages with the following code:Code:Private Sub doSend(strTo, strFrom, strSubject, strMessage, strAttachment) On Error GoTo ErrorHandler Set imsg = CreateObject("cdo.message") Set iconf = CreateObject("cdo.configuration") Set Flds = iconf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 'IP Address of SMTP Server .Update End With Dim strReceiveremail, strFrom, strSubject, strHTML As String With imsg Set .Configuration = iconf .To = strTo .From = strFrom .Subject = strSubject .HTMLBody = strMessage .Fields.Update .AddAttachment (strAttachement) .Send End With Set imsg = Nothing Set iconf = Nothing ErrorHandler: If Err.Number <> 0 Then While Err.Number <> 0 Call doSend Wend Unload Me End If End Sub
This is working, insomuch as all of my emails are being sent - the function is re-trying until they get through. My problem is that the page has to wait for the email to be sent until it can continue to load which may take 30 seconds.Code:<% Dim strMessage strMessage = Request.Form("Full_Name") & vbVerticalTab & vbCrLf & "Submitted Feedback on " & Date & vbCr & "------------------------" & vbCrLf & "Question: " & Request.Form("Question") Dim objSendMail Set objSendMail = Server.CreateObject("AutoEMail.Class1") call objSendMail.doSend("sync_or_swim@test.co.uk", "someaddress@fakedomain.co.uk", "User Feedback Submitted", strMessage) Set objSendMail = Nothing Response.Write("Thank you. Your message has been sent to the Database Administrator") %>
And now for my question, finally!!!
Is there any way that I can call my dll from the asp page so that it runs in the background? Ie. So that it keeps trying to resend the message, but passes control back to the asp pages straight away so that I can do something else and the user doesn't have to wait for the email to send and there is no delay in the page loading.
Does anybody know if this is possible or am I on a wild goose chase?



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks