Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
8269d576
Kaydet (Commit)
8269d576
authored
Ock 06, 2013
tarafından
Julien Nabet
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix type SMPT->SMTP
Change-Id: I09dfd8c2385e6257248b6a43ee4e2ce97ee6bdfc
üst
2ba80e59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
mailmerge.py
scripting/source/pyprov/mailmerge.py
+15
-15
No files found.
scripting/source/pyprov/mailmerge.py
Dosyayı görüntüle @
8269d576
...
@@ -61,23 +61,23 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
...
@@ -61,23 +61,23 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
self
.
connectioncontext
=
None
self
.
connectioncontext
=
None
self
.
notify
=
EventObject
()
self
.
notify
=
EventObject
()
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service init"
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service init"
,
file
=
dbgout
)
def
addConnectionListener
(
self
,
xListener
):
def
addConnectionListener
(
self
,
xListener
):
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service addConnectionListener"
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service addConnectionListener"
,
file
=
dbgout
)
self
.
listeners
.
append
(
xListener
)
self
.
listeners
.
append
(
xListener
)
def
removeConnectionListener
(
self
,
xListener
):
def
removeConnectionListener
(
self
,
xListener
):
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service removeConnectionListener"
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service removeConnectionListener"
,
file
=
dbgout
)
self
.
listeners
.
remove
(
xListener
)
self
.
listeners
.
remove
(
xListener
)
def
getSupportedConnectionTypes
(
self
):
def
getSupportedConnectionTypes
(
self
):
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service getSupportedConnectionTypes"
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service getSupportedConnectionTypes"
,
file
=
dbgout
)
return
self
.
supportedtypes
return
self
.
supportedtypes
def
connect
(
self
,
xConnectionContext
,
xAuthenticator
):
def
connect
(
self
,
xConnectionContext
,
xAuthenticator
):
self
.
connectioncontext
=
xConnectionContext
self
.
connectioncontext
=
xConnectionContext
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service connect"
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service connect"
,
file
=
dbgout
)
server
=
xConnectionContext
.
getValueByName
(
"ServerName"
)
server
=
xConnectionContext
.
getValueByName
(
"ServerName"
)
if
dbg
:
if
dbg
:
print
(
server
,
file
=
dbgout
)
print
(
server
,
file
=
dbgout
)
...
@@ -110,7 +110,7 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
...
@@ -110,7 +110,7 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
listener
.
connected
(
self
.
notify
)
listener
.
connected
(
self
.
notify
)
def
disconnect
(
self
):
def
disconnect
(
self
):
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service disconnect"
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service disconnect"
,
file
=
dbgout
)
if
self
.
server
:
if
self
.
server
:
self
.
server
.
quit
()
self
.
server
.
quit
()
self
.
server
=
None
self
.
server
=
None
...
@@ -118,17 +118,17 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
...
@@ -118,17 +118,17 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
listener
.
disconnected
(
self
.
notify
)
listener
.
disconnected
(
self
.
notify
)
def
isConnected
(
self
):
def
isConnected
(
self
):
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service isConnected"
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service isConnected"
,
file
=
dbgout
)
return
self
.
server
!=
None
return
self
.
server
!=
None
def
getCurrentConnectionContext
(
self
):
def
getCurrentConnectionContext
(
self
):
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service getCurrentConnectionContext"
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service getCurrentConnectionContext"
,
file
=
dbgout
)
return
self
.
connectioncontext
return
self
.
connectioncontext
def
sendMailMessage
(
self
,
xMailMessage
):
def
sendMailMessage
(
self
,
xMailMessage
):
COMMASPACE
=
', '
COMMASPACE
=
', '
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service sendMailMessage"
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service sendMailMessage"
,
file
=
dbgout
)
recipients
=
xMailMessage
.
getRecipients
()
recipients
=
xMailMessage
.
getRecipients
()
sendermail
=
xMailMessage
.
SenderAddress
sendermail
=
xMailMessage
.
SenderAddress
sendername
=
xMailMessage
.
SenderName
sendername
=
xMailMessage
.
SenderName
...
@@ -136,10 +136,10 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
...
@@ -136,10 +136,10 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
ccrecipients
=
xMailMessage
.
getCcRecipients
()
ccrecipients
=
xMailMessage
.
getCcRecipients
()
bccrecipients
=
xMailMessage
.
getBccRecipients
()
bccrecipients
=
xMailMessage
.
getBccRecipients
()
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service subject "
+
subject
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service subject "
+
subject
,
file
=
dbgout
)
print
(
"PyMailSM
PT
Service from "
+
sendername
.
encode
(
'utf-8'
),
file
=
dbgout
)
print
(
"PyMailSM
TP
Service from "
+
sendername
.
encode
(
'utf-8'
),
file
=
dbgout
)
print
(
"PyMailSMTPService from "
+
sendermail
,
file
=
dbgout
)
print
(
"PyMailSMTPService from "
+
sendermail
,
file
=
dbgout
)
print
(
"PyMailSM
PT
Service send to "
+
recipients
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service send to "
+
recipients
,
file
=
dbgout
)
attachments
=
xMailMessage
.
getAttachments
()
attachments
=
xMailMessage
.
getAttachments
()
...
@@ -148,13 +148,13 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
...
@@ -148,13 +148,13 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
content
=
xMailMessage
.
Body
content
=
xMailMessage
.
Body
flavors
=
content
.
getTransferDataFlavors
()
flavors
=
content
.
getTransferDataFlavors
()
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service flavors len "
+
len
(
flavors
),
file
=
dbgout
)
print
(
"PyMailSM
TP
Service flavors len "
+
len
(
flavors
),
file
=
dbgout
)
#Use first flavor that's sane for an email body
#Use first flavor that's sane for an email body
for
flavor
in
flavors
:
for
flavor
in
flavors
:
if
flavor
.
MimeType
.
find
(
'text/html'
)
!=
-
1
or
flavor
.
MimeType
.
find
(
'text/plain'
)
!=
-
1
:
if
flavor
.
MimeType
.
find
(
'text/html'
)
!=
-
1
or
flavor
.
MimeType
.
find
(
'text/plain'
)
!=
-
1
:
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service mimetype is "
+
flavor
.
MimeType
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service mimetype is "
+
flavor
.
MimeType
,
file
=
dbgout
)
textbody
=
content
.
getTransferData
(
flavor
)
textbody
=
content
.
getTransferData
(
flavor
)
try
:
try
:
textbody
=
textbody
.
value
textbody
=
textbody
.
value
...
@@ -232,7 +232,7 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
...
@@ -232,7 +232,7 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
truerecipients
=
uniquer
.
keys
()
truerecipients
=
uniquer
.
keys
()
if
dbg
:
if
dbg
:
print
(
"PyMailSM
PT
Service recipients are "
+
truerecipients
,
file
=
dbgout
)
print
(
"PyMailSM
TP
Service recipients are "
+
truerecipients
,
file
=
dbgout
)
self
.
server
.
sendmail
(
sendermail
,
truerecipients
,
msg
.
as_string
())
self
.
server
.
sendmail
(
sendermail
,
truerecipients
,
msg
.
as_string
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment