SKAF#27580 Bijlagen netter meesturen

svn path=/Website/trunk/; revision=19587
This commit is contained in:
Jos Groot Lipman
2013-10-23 13:34:18 +00:00
parent 2903786d28
commit 137e54cdf7

View File

@@ -57,9 +57,9 @@ Public Function SendMail(ByVal mailfrom As String _
Dim objFSO As New FileSystemObject
Dim objFiles As Files, objFile As File
Dim objFolders As Folders, objFolder As Folder
Log2File 3, "In SendMail sender=" + mailfrom
SendMail = False
' Determine the sender
If mailfrom = "" Then
@@ -81,7 +81,7 @@ Public Function SendMail(ByVal mailfrom As String _
Log2File 1, "Notification email not sent..."
Exit Function
End If
If (body <> "") Then
MailObj.TextBody = body
If bodyHTML <> "" Then ' Als attachment er bij
@@ -124,9 +124,9 @@ Public Function SendMail(ByVal mailfrom As String _
Set objFiles = objFolder.Files
For Each objFile In objFiles
Log2File 1, "Adding attachment: " & objFile.path & " (" & objFile.Size & " bytes)"
If AttachPassword = "" Then ' doe maar gewoon
MailObj.AddRelatedBodyPart objFile.path, objFile.name, 0
MailObj.AddAttachment objFile.path, objFile.name
Else
Dim ZipObjIn As Object
Set ZipObjIn = CreateObject("SLNKDWF.Zip")
@@ -153,14 +153,14 @@ Public Function SendMail(ByVal mailfrom As String _
Call ZipObjOut.ZipFromStream(orgName, oStream, AttachPassword)
oStream.Close
ZipObjOut.Close
MailObj.AddRelatedBodyPart tempfile, orgName + ".zip", 0
MailObj.AddAttachment tempfile, orgName + ".zip"
Kill tempfile ' MailObj houdt hem nog even gelocked maar straks is hij wel weg
End If
Next
Next
End If
End If
MailObj.From = MailSender
MailObj.ReplyTo = MailReply
MailObj.To = mailto
@@ -171,18 +171,18 @@ Public Function SendMail(ByVal mailfrom As String _
MailObj.fields(cdoReturnReceiptTo) = ReceiptTo
MailObj.fields.Update
End If
If ForceMailAddress <> "null" Then
MailObj.To = ForceMailAddress
End If
If ForceFromAddress <> "null" Then
MailObj.From = ForceFromAddress
MailObj.ReplyTo = ForceFromAddress
End If
MailObj.subject = subject
If Not StreamAttachment Is Nothing Then
If (StreamAttachment.Size <> 0) Then
Log2File 2, "Before set addBodyPart"
@@ -201,13 +201,13 @@ Public Function SendMail(ByVal mailfrom As String _
End With
End If
End If
If ForceMailAddress <> "null" Then
Log2File 1, "Sending email '" + subject + "' from: " + MailSender + "' to: " + mailto + "(effective: " + ForceMailAddress + ")"
Else
Log2File 1, "Sending email '" + subject + "' from: " + MailSender + " to: " + mailto
End If
If mailto <> "" Then
MailObj.send
Log2File 2, "Sent."