-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSample_VBA_Code
More file actions
56 lines (30 loc) · 1.18 KB
/
Copy pathSample_VBA_Code
File metadata and controls
56 lines (30 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Public Function PDO_SMTP_COM_Addin()
On Error Resume Next
' PDO: Requires installed COM-Addin "PDO_SMTP_AddIn" , see Extras -> References
Dim objMail As PDO_SMTP_AddIn.SendMail_using_SMTP
Set objMail = New PDO_SMTP_AddIn.SendMail_using_SMTP
' PDO: Check connection to COM-Addin
Debug.Print objMail.HelloWorld
' PDO: Prepare Mail
objMail.smtpServer "smtp.yourserver.de"
objMail.IsSSL True
objMail.Password InputBox("Password")
objMail.EmailFrom "john@doe.de"
objMail.To_Add "jane@doe.de"
'objMail.To_Add "nick@doe.de"
objMail.CC_Add "nick@doe.de"
objMail.BCC_Add "nick2@doe.de"
objMail.Subject "This is my new subject"
objMail.HTMLBody "The <strong>body</strong> of it, at " & Now()
objMail.Attachment_Add "C:\Users\yours\Desktop\Sammy.gif"
' PDO: Send Mail
Debug.Print objMail.SendMail()
Err_Handler:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
Set objMail = Nothing
' ****************************************
' C|:-) www.pdo.digital says Thank you !
' ****************************************
End Function