Aloaha WebDAV Mailer

The Aloaha WebDAV mailer is part of the Aloaha PDF Suite. The WebDAV API itself is freeware and can be used without having to purchase a valid Aloaha PDF Suite license.

Please find a sample on how to use the WebDAV Mailer below:

Why do I need WebDAV?

  • You need to send automated emails via Hotmail, GMX etc
  • Unlike SMTP emails sent via WebDAV will appear in your sent items Folder
  • You need to send emails but between you and your exchange is a firewall
  • Port 25 not available - lots of ISPs nowadays block that port

 Download WebDAV Mailer sample (1,84 KB)


'This simple script demonstrates
'how to use WebDAV to send an email.
'The WebDAV Mailer is a freeware component
'of the Aloaha PDF Suite.
'http://www.aloaha.com/download/aloaha_pdf.zip

dim webdav
dim msg
dim strmail

dim ExchangeAlias
dim ExchangeUsername
dim ExchangeServer
dim ExchangePassword


set webdav=createobject("aloahadav.webdav") 

'Please note the difference between Alias and Name
webdav.ExchangeAlias="stefan"  
webdav.ExchangeUsername="helgoland\stefan" 

webdav.ExchangeServer="gate"
webdav.ExchangePassword="stefanspassword" 

'Test if a connection can be made with the
'given credentials
if webdav.test_connection( _
   cstr(webdav.ExchangeServer), _
   cstr(webdav.ExchangeAlias), _
   cstr(webdav.ExchangeUsername), _
   cstr(webdav.ExchangePassword)) = true then
  
  'create email in memory
  Set msg = CreateObject("CDO.Message")
  
  msg.To = "stefan@aloaha.com"
  
  'please note that the from MUST be
  'the email address of the used User
  msg.From = "stefan@aloaha.com"
  
  msg.Subject="Testmail - sent via WebDAV"
  msg.TextBody="Test"
  
  'msg.AddAttachment ("C:\boot.ini")
  
  strmail=cdo2text(msg)
  if len(strmail)>0 then
   if webdav.senddavmail(cstr(strmail))=true then
    msgbox "sent"
   else
    msgbox "problem"
   end if
  end if
  
  set msg=nothing
else
 msgbox "WebDAV Connection failed"
end if 

set webdav=nothing

'function below converts any CDO Object
'into a plain Ascii String

Function cdo2text(cdomsg)
 Const adTypeText = 2
 dim ado 
     
     Set ado = CreateObject("ADODB.Stream")
     ado.Type = adTypeText
     ado.Charset = "US-ASCII"
     Set ado = cdomsg.GetStream
     ado.Type = adTypeText
     ado.Charset = "US-ASCII"
     cdo2text = ado.ReadText
     set ado=nothing

End Function





Please ask...

Although we really tried hard, there are always questions left open.

Please send us your question.
We would be glad to answer it.
PDF SDKPDF Form Saver SDKSmart Card APIAloaha Web ServicesAloaha Print MonitorAloaha Remote ConfigurationWebDAVWebDAV MailerLDAP ClientProgramming Office MacrosIIS Event Sinks