Guten Tag,
gibt es eine Möglichkeit per AHK ohne externe Software, ein E-mail zu verschicken?
LG
Direkter E-Mail-Versand ohne externe Software Topic is solved
Moderator: jNizM
Re: Direkter E-Mail-Versand ohne externe Software
Eine Möglichkeit habe ich gefunden, es funktioniert auch.
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=31437&hilit=powershell
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=31437&hilit=powershell
Re: Direkter E-Mail-Versand ohne externe Software Topic is solved
Hallo,
du kannst auch die CDO-Api nutzen.
weitere Hilfe: gogl und hier: https://support.microsoft.com/de-de/help/310212/how-to-use-the-cdosys-dll-library-to-send-an-e-mail-message-with-attac
hier gibt es noch was zur powershell-funktion:
https://www.autohotkey.com/boards/viewtopic.php?f=9&t=31817&p=148376&hilit=cdo#p148376
du kannst auch die CDO-Api nutzen.
Code: Select all
Emfa = "[email protected]"
path := "C:\Users\abc\Desktop\123.png" ; Pfad+Dateiname Anhang
pmsg := ComObjCreate("CDO.Message")
pmsg.From := "[email protected]"
pmsg.To := Emfa
pmsg.BCC := "" ; Blind Carbon Copy, Invisible for all, same syntax as CC
;pmsg.CC := "" ; [email protected], [email protected]
pmsg.Subject := "Test"
;pmsg.TextBody := ""
pmsg.HtmlBody := "<HTML><H2>Meldung!!!!</H2><BODY>Maschine:"
sAttach := path ; can add multiple attachments, the delimiter is |
fields := Object()
fields.smtpserver := "smtp.absender.de" ; specify your SMTP server
fields.smtpserverport := 25 ; 25
fields.smtpusessl := False ; False
fields.sendusing := 2 ; cdoSendUsingPort
fields.smtpauthenticate := 1 ; cdoBasic
fields.sendusername := "absender"
;fields.sendpassword := "xxxxxxxx"
fields.smtpconnectiontimeout := 60
schema := "http://schemas.microsoft.com/cdo/configuration/"
pfld := pmsg.Configuration.Fields
For field,value in fields
pfld.Item(schema . field) := value
pfld.Update()
;Loop, Parse, sAttach, |, %A_Space%%A_Tab%
pmsg.AddAttachment(path)
pmsg.Send()
return
hier gibt es noch was zur powershell-funktion:
https://www.autohotkey.com/boards/viewtopic.php?f=9&t=31817&p=148376&hilit=cdo#p148376
Re: Direkter E-Mail-Versand ohne externe Software
Hallo @Ahk_fan und danke für den Vorschlag.
Bekomme, immer die Meldung:
====
Error: 0x80040213 -
Source: CDO.Message.1
Description: Der Transport konnte keine Verbindung zum Server herstellen.
====
Die Zugangsdaten stimmen und Firewall ist deaktiviert.
Es ist ein Outlook-Account folgende Veränderungen habe ich vorgenommen:
fields.smtpserver := "SMTP.office365.com"
fields.smtpserverport := 587
fields.smtpusessl := True
Bekomme, immer die Meldung:
====
Error: 0x80040213 -
Source: CDO.Message.1
Description: Der Transport konnte keine Verbindung zum Server herstellen.
====
Die Zugangsdaten stimmen und Firewall ist deaktiviert.
Es ist ein Outlook-Account folgende Veränderungen habe ich vorgenommen:
fields.smtpserver := "SMTP.office365.com"
fields.smtpserverport := 587
fields.smtpusessl := True
Re: Direkter E-Mail-Versand ohne externe Software
hmm,
ich habe es gerade mit strato, googlemail, und web.de getestet --> funktioniert
bei office365 ist es auf jeden fall "smtp.office365.com"
Port 587
hast du:
bei fields.sendpassword muss das semikolon vornedran weg und dein passwort rein. Bei Username muss evtl nur der Emailname vor dem @, oder der komplette Emailname rein inkl. @account.com....
ich habe es gerade mit strato, googlemail, und web.de getestet --> funktioniert
bei office365 ist es auf jeden fall "smtp.office365.com"
Port 587
hast du:
Code: Select all
fields.sendusername := "absender"
fields.sendpassword := "xxxxxxxx"
Re: Direkter E-Mail-Versand ohne externe Software
teste mal port 25 und füge noch die Zeile
fields.sendtls := True
dazwischen (vor dem .send auf jeden Fall)
das habe ich im netz gefunden(https://www.tachytelic.net/2018/12/email-vbscript-vba-office-365/):
- The account that you use must have at least an Exchange Online license.
- You will only be able to send from addresses that account has send as permission for or an alias of that account.
- It would probably be a good idea to use an account dedicated for sending SMTP because the password is being stored in clear text.
- Your Firewall or your ISPs Firewall may block outbound port 25.
- I’ve left the code for TLS in-place above but commented out, in case anyone else wants to have a play with it.
fields.sendtls := True
dazwischen (vor dem .send auf jeden Fall)
das habe ich im netz gefunden(https://www.tachytelic.net/2018/12/email-vbscript-vba-office-365/):
- The account that you use must have at least an Exchange Online license.
- You will only be able to send from addresses that account has send as permission for or an alias of that account.
- It would probably be a good idea to use an account dedicated for sending SMTP because the password is being stored in clear text.
- Your Firewall or your ISPs Firewall may block outbound port 25.
- I’ve left the code for TLS in-place above but commented out, in case anyone else wants to have a play with it.
Re: Direkter E-Mail-Versand ohne externe Software
Danke Dir! fields.sendtls := True und port 25, damit funktioniert es mit Outlook.
Who is online
Users browsing this forum: No registered users and 24 guests