Solution:
http://msdn.microsoft.com/library/de...il_object_.asp
In short:
objMail.AttachFile s, s, 1 '' EncodingMethod setting (0 - CdoEncodeingUUencode, 1 - CdoEncodingBase64)
All the code:
function sendmail(recipient_address, sender_address, subject, body, attachment)
Dim objMail, n, n0, s
on error resume next
set objMail = CreateObject("CDONTS.NewMail")
objMail.From = sender_address
objMail.To = recipient_address
objMail.Subject = subject
objMail.Body = body
if trim(attachment) > "" then
n = InStr(1,attachment,",")
if n = 0 then
s = trim(attachment)
objMail.AttachFile s, s, 1 '' EncodingMethod setting (0 - CdoEncodeingUUencode, 1 - CdoEncodingBase64)
else
n0 = 0
Do while n > 0
s = trim(Mid(attachment,n0+1,n-n0-1))
objMail.AttachFile s, s, 1
n0 = n
n = InStr(n0+1,attachment,",")
Loop
s = trim(Mid(attachment,n0+1))
objMail.AttachFile s, s, 1
end if
end if
objMail.MailFormat = 0 'CdoMailFormatMime
objMail.BodyFormat = 0 'CdoBodyFormatHTML
objMail.Send
set objMail = nothing
sendmail = err.number
on error goto 0
end function
Jorge