Direkter E-Mail-Versand ohne externe Software

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Direkter E-Mail-Versand ohne externe Software

Re: Direkter E-Mail-Versand ohne externe Software

Post by KHA » 24 Oct 2019, 14:18

Danke Dir! fields.sendtls := True und port 25, damit funktioniert es mit Outlook.

Re: Direkter E-Mail-Versand ohne externe Software

Post by Ahk_fan » 24 Oct 2019, 13:41

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.

Re: Direkter E-Mail-Versand ohne externe Software

Post by Ahk_fan » 24 Oct 2019, 13:36

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:

Code: Select all

	fields.sendusername 					:= "absender"
		fields.sendpassword 					:= "xxxxxxxx"
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....

Re: Direkter E-Mail-Versand ohne externe Software

Post by KHA » 23 Oct 2019, 15:47

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

Re: Direkter E-Mail-Versand ohne externe Software

Post by Ahk_fan » 22 Oct 2019, 13:32

Hallo,

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
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

Re: Direkter E-Mail-Versand ohne externe Software

Post by KHA » 20 Oct 2019, 09:17

Eine Möglichkeit habe ich gefunden, es funktioniert auch.

https://www.autohotkey.com/boards/viewtopic.php?f=6&t=31437&hilit=powershell

Direkter E-Mail-Versand ohne externe Software

Post by KHA » 20 Oct 2019, 07:43

Guten Tag,
gibt es eine Möglichkeit per AHK ohne externe Software, ein E-mail zu verschicken?
LG

Top