Alex Dybenko said:
Hi Alessandro,
so maybe provider does not allow you to send such a big emails? what
error
you get?
Hi mr. Alex
Around 800÷1000 Kb i have the max upper limit.
It's not the provider because with Outlook_Express i usually
send more than 5Mb in a single File Attach....!
This is a part of Code wich i use to send Attach the error come from
HandleError
and no Error Number and no Description....!
It can be caused from TimeOut Socket...?
(but with Winsock.Ocx i don't know how to modify this time....!)
I'm not sure it's TimeOut but now with DelayLooping on Buffer my error
come
just 1,7Mb....!!!!!!
If i send many attachs and the total dimension was less then 1Mb no
problem
at all
so i'm sure that the code is correct...!
If Len(mAttach) > 0 Then
Dim lPtr As Long
Dim Attachment As Variant
Dim EncodeAttach As String
msgBody = msgBody & "--" & strBoundary & "--" & vbCrLf & vbCrLf
Attachment = Split(mAttach, ";")
' Check and send each single attach
For lPtr = 0 To UBound(Attachment) - 1
' test if the attach exist
If Dir(Attachment(lPtr)) = "" Then
'AddError ERR_FILE_NOT_EXIST
'
'Not implemented the Error JUST SKIPP
Goto Skipp
End If
'This codify on 64Base my AttachPointer
EncodeAttach = Code64(CStr(Attachment(lPtr)))
AttachName = ParseFileName(CStr(Attachment(lPtr)))
msgBody = msgBody & "--" & strBoundary & vbCrLf
msgBody = msgBody & "Content-Type:
application/octet-stream;"
& vbCrLf
msgBody = msgBody & vbTab & "name=" & Chr$(34) & AttachName
&
Chr$(34) & vbCrLf
msgBody = msgBody & "Content-Transfer-Encoding: base64" &
vbCrLf
msgBody = msgBody & "Content-Disposition: attachment;" &
vbCrLf
msgBody = msgBody & vbTab & "filename=" & Chr$(34) &
AttachName & Chr$(34) & vbCrLf & vbCrLf
msgBody = msgBody & EncodeAttach & vbCrLf
wsk.SendData (msgBody)
msgBody = ""
' Waiting for Buffer dimension
Do While mBytesRemaining > 4096
' Gestione del TIMEOUT
fStart = Timer
If fStart < 86400 Then
fTimeOut = fStart
Else
fTimeOut = (fStart - 86400)
End If
' If mBytesRemaining change i still sending....!
' [mBytesRemaining] come from Sending Progress
Winsock
lSendBuffSize = mBytesRemaining
Do Until lSendBuffSize <> mBytesRemaining
If mBytesRemaining < 4096 Then Exit Do
If Timer >= fTimeOut Then
GoTo HandleError
End If
Sleep (10)
DoEvents
Loop
Loop
Skipp:
Next
End If
' CLOSE MAIL MESSAGE
msgBody = ""
msgBody = msgBody & vbCrLf
msgBody = msgBody & "--" & strBoundary & "--" & vbCrLf
msgBody = msgBody & vbCrLf & "." & vbCrLf
DoEvents
wsk.SendData (msgBody)
Call getreply: If Left(strData, 3) <> "250" Then GoTo HandleError
GoTo CHIUDI
HandleError:
MsgBox "Server error Replay: " & vbCrLf & wsk.RemoteHost & vbCrLf & _
Err.Description & " - " & Err.Number
wsk.Close: SendMail = -1
CHIUDI:
End Function
Many thanks for your help.