Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 5th, 2007, 07:09 AM
b00gieman's Avatar
b00gieman b00gieman is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Europe
Posts: 232 b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 11 h 42 m 20 sec
Reputation Power: 109
Cdo email not delivering the messages

Regarding this thread:http://forums.aspfree.com/microsoft-iis-12/smtp-server-problem-194417.html] , could somebody tell me if I should modify something to the component in order to work?
the whole code looks like this:
Code:

Public ErrorStrMail As Variant
Dim oMail As CDO.Message
Dim oConf As CDO.Configuration
Dim FileSize
Dim SumSize
Dim oFlds
Dim oFSO
Dim oFile
Dim sFolder
Dim oFolder
Dim user
Private SMTPSrvr As String
Private SMTPPrt As Integer
Private Sndusing As Integer

Property Let SMTPServer(text As String)
    SMTPSrvr = text
End Property

Property Let SMTPPort(valu As Integer)
    SMTPPrt = valu
End Property

Property Let SendUsing(valu2 As Integer)
    Sndusing = valu2
End Property

Public Function SendMail(toAddr, whoAddr, docSubj, docMsg, ByVal docType As Integer, Optional cc = "", Optional bcc = "", Optional sFolder = "", Optional user = "")
    On Error GoTo MailErr
    Set oFlds = oConf.Fields
    oFlds(cdoSendUsingMethod) = Sndusing
    oFlds(cdoSMTPServer) = SMTPSrvr
    oFlds(cdoSMTPServerPort) = SMTPPrt
    oFlds(cdoSMTPAuthenticate) = cdoBasic
    oFlds.Update
    Set oMail = New CDO.Message
    oMail.From = whoAddr
    oMail.To = toAddr
    If (cc <> "") Then
        oMail.cc = cc
        If (bcc <> "") Then
            oMail.bcc = bcc
            If oFSO.FolderExists(sFolder) Then
               Set oFolder = oFSO.GetFolder(sFolder)
                  For Each oFile In oFolder.Files
                      If InStr(oFile.Name, "_" & user) > 0 Then
                                     oMail.AddAttachment oFile.Path
                                     FileSize = Format((FileLen(oFile) / 1024) / 1024)
                                     SumSize = SumSize + FileSize
                                     oFSO.DeleteFile (oFile)
                      End If
                  Next
            End If
        End If
    End If
    If ((docType Mod 2) = 0) Then
        oMail.TextBody = docMsg
        Else:
        oMail.HTMLBody = docMsg
    End If
    If (SumSize > 10) Then
       ErrorStrMail = "Attachment size too large!"
       GoTo MailFlee
    End If
    oMail.Subject = docSubj
    Set oMail.Configuration = oConf
    oMail.Send
MailFlee:
    Exit Function
MailErr:
    ErrorStrMail = Err.Number & ":" & Err.Description
    Resume MailFlee
End Function

Private Sub Class_Initialize()
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    Set oConf = New CDO.Configuration
    Set oFlds = oConf.Fields
    FileSize = 0
    SumSize = 0
    oFlds(cdoSendUsingMethod) = Sndusing
    oFlds(cdoSMTPServer) = SMTPSrvr
    oFlds(cdoSMTPServerPort) = SMTPPrt
    oFlds(cdoSMTPAuthenticate) = cdoBasic
    oFlds.Update
End Sub


Thanks in advance!

Reply With Quote
  #2  
Old November 5th, 2007, 08:56 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,932 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 17 m 53 sec
Reputation Power: 2002
--moved to the VB forum.

regarding your question: yes, you have to define SMTPSrvr. currently
in your code it's empty so it's obvious you'll get error. if the mail server
is the same as the web server, give this "localhost" or "127.0.0.1" value.

Reply With Quote
  #3  
Old November 5th, 2007, 01:42 PM
b00gieman's Avatar
b00gieman b00gieman is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Europe
Posts: 232 b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 11 h 42 m 20 sec
Reputation Power: 109
Quote:
--moved to the VB forum.
Thanks!
Regarding the value of SMTPSrvr....that value and the SMTPPrt,and SndUsing are set in the asp page......the smtp server I'm using is a mail server...I dunno if I'm missing something here....

Reply With Quote
  #4  
Old November 6th, 2007, 07:07 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,932 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 17 m 53 sec
Reputation Power: 2002
Quote:
Originally Posted by b00gieman
Thanks!
Regarding the value of SMTPSrvr....that value and the SMTPPrt,and SndUsing are set in the asp page......the smtp server I'm using is a mail server...I dunno if I'm missing something here....
so contact your host and ask for valid SMTP Server address.

Reply With Quote
  #5  
Old November 6th, 2007, 09:54 AM
b00gieman's Avatar
b00gieman b00gieman is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Europe
Posts: 232 b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 11 h 42 m 20 sec
Reputation Power: 109
the SMTP Server address I'm using is valid...

Reply With Quote
  #6  
Old November 7th, 2007, 06:01 AM
b00gieman's Avatar
b00gieman b00gieman is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Europe
Posts: 232 b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 11 h 42 m 20 sec
Reputation Power: 109
I'm being told that the following thing happens : the application tries to connect to the server , but the process is put on hold until it stops.Could this be related to the connection timeout (if it's not set,it could have a default value....)?

Reply With Quote
  #7  
Old November 7th, 2007, 06:22 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,932 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 17 m 53 sec
Reputation Power: 2002
this can be related to many things: network problems and permissions problems
are two common problems.

Reply With Quote
  #8  
Old November 7th, 2007, 06:31 AM
b00gieman's Avatar
b00gieman b00gieman is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Europe
Posts: 232 b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 11 h 42 m 20 sec
Reputation Power: 109
Dunno if this is somehow related to permissions....apparently the application is in the list of applications that are allowed to use the email server.....but if the component would be wrong developed,would it be possible to work from time to time?this is what bothers me....

Reply With Quote
  #9  
Old November 7th, 2007, 06:32 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,932 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 17 m 53 sec
Reputation Power: 2002
keep in mind that if you call this component from within ASP, you will
have very limited permissions of the IUSR account of the web server.

Reply With Quote
  #10  
Old November 7th, 2007, 07:33 AM
b00gieman's Avatar
b00gieman b00gieman is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Europe
Posts: 232 b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 11 h 42 m 20 sec
Reputation Power: 109
I tried sending an email from an asp page and it works....dunno what's wrong with the component....

Reply With Quote
  #11  
Old November 7th, 2007, 07:43 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,932 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 17 m 53 sec
Reputation Power: 2002
probably some fancy code using something that needs permissions.
try to add Try..Catch blocks to the code to narrow the possibilities down.

Reply With Quote
  #12  
Old November 8th, 2007, 04:04 AM
b00gieman's Avatar
b00gieman b00gieman is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Europe
Posts: 232 b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)