|
You last visited: Today at 16:09
Advertisement
.txt datei per E-Mail versenden
Discussion on .txt datei per E-Mail versenden within the AutoIt forum part of the Coders Den category.
01/16/2011, 22:16
|
#1
|
elite*gold: 0
Join Date: Feb 2010
Posts: 40
Received Thanks: 1
|
.txt datei per E-Mail versenden
Hallo,
ich möchte für ein Projekt ein Programm erstellen was eine .txt Datei an mich per E-Mail schickt dieses sollte aber für Benutzer sehr einfach sein sie mir zu schicken.
Also das Programm schreibt eine .txt Datei und soll sie an meine E-Mail Adresse gesendet werden.
|
|
|
01/16/2011, 22:32
|
#2
|
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
|
und jetz? erwartest du dass wir dir ein fertiges script zum C&P hin posten?
google einfach
|
|
|
01/16/2011, 22:42
|
#3
|
elite*gold: 0
Join Date: Feb 2010
Posts: 40
Received Thanks: 1
|
Nein das erwarte ich nicht, ich suche nur eine Hilfe um es zu verschicken das andere weis ich ja.
|
|
|
01/17/2011, 17:00
|
#4
|
elite*gold: 0
Join Date: Sep 2010
Posts: 487
Received Thanks: 196
|
Ich kann dir weiterhelfen...
Hier eine UDF von Blog4it
PHP Code:
Const $cdoSendUsingPickup = 1 ;Send message using the local SMTP service pickup directory.
Const $cdoSendUsingPort = 2 ;Send the message using the network (SMTP over the network).
Global $objmessage
Func _blog4itmail($betreff,$from,$from_name,$to,$smtp_server,$smtp_user, _
$smtp_passwort,$smtp_port = 25, $smpt_ssl = False)
Global $objMessage = ObjCreate("CDO.Message")
$objMessage.Subject = $betreff
$objMessage.From = '"'& $from_name &'" <'& $from &'>'
$objMessage.To = $to
$objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
;Name oder IP des SMTP Servers
$objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $smtp_server
;Type of authentication, NONE, Basic (Base64 encoded), NTLM
$objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1; 0=Do not authenticate / 1=basic (clear-text) authentication / 2=NTLM
;Your UserID on the SMTP server
$objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = $smtp_user
;Your password on the SMTP server
$objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $smtp_passwort
;Server port (typically 25)
$objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $smtp_port
;Use SSL for the connection (False or True)
$objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = $smpt_ssl
;Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
$objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
$objMessage.Configuration.Fields.Update
EndFunc
Func _blog4itmail_text($string)
$objMessage.TextBody = $string
EndFunc
Func _blog4itmail_textfromfile($strPfad)
Dim $f = FileOpen($strPfad,0)
$objMessage.TextBody = FileRead($f)
FileClose($f)
EndFunc
Func _blog4itmail_htmltext($string)
$objMessage.HTMLBody = $string
EndFunc
Func _blog4itmail_htmlfromurl($url)
$objMessage.CreateMHTMLBody ($url)
EndFunc
Func _blog4itmail_htmlfrompfad($strPfad)
$objMessage.CreateMHTMLBody ("file://" & $strPfad)
EndFunc
Func _blog4itmail_anhang($strPfad)
$objMessage.AddAttachment ($strPfad)
EndFunc
Func _blog4itmail_send()
$objmessage.send
EndFunc
Hier ein Beispiel
PHP Code:
#include <udfblog4itmail.au3>
_blog4itmail('Testnachricht ' & @HOUR & ':' & @MIN & ':' & @SEC , _
'ABSENDER EMAIL', _
'ABSENDER NAME', _
'EMPFÄNGER EMAIL', _
'SMTP MAIL SERVER (z.B. STMP.WEB.DE)', _
'SMTP ANMELDENAME', _
'SMTP PASSWORT', _
'SMTP PORT', _
false)
_blog4itmail_text('c:\test.html')
;_blog4itmail_anhang('c:\boot.ini') ; damit kann man .txt z.B versenden
;_blog4itmail_anhang('c:\config.sys')
_blog4itmail_send()
Noch ein beispiel
PHP Code:
Local $sendername, $username, $userpassword, $smtpserver
If FileExists('settings.ini') Then
If readSettings() = False Then
FileDelete('settings.ini')
MsgBox(16,"Fehler","Es wurden nicht alle benötigten Angaben gefunden, INI Datei gelöscht. Programm wird beendet.")
Exit
EndIf
Else
IniWrite('settings.ini','konto','sender',InputBox("Absender-Name","Bitte gib deine Absender Namen ein:","Hans Meiser"))
IniWrite('settings.ini','konto','from',InputBox("Absender-Mail","Bitte gib deine Absender Email ein:"," "))
IniWrite('settings.ini','konto','password',InputBox("Passwort-Mail","Bitte gib dein Email-Passwort ein:","Passwort","*"))
IniWrite('settings.ini','konto','smtp',InputBox("Passwort-Mail","Bitte gib dem SMTP (Postausgangsserver) ein:","smtp.web.de"))
readSettings();
EndIf
Func readSettings()
$sendername = IniRead('settings.ini','konto','sender','null')
$username = IniRead('settings.ini','konto','from','null')
$userpassword = IniRead('settings.ini','konto','password','null')
$smtpserver = IniRead('settings.ini','konto','smtp','null')
If $sendername = 'null' Or $username = 'null' Or $userpassword = 'null' Or $smtpserver = 'null' then return False
Return True
EndFunc
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$frmMain = GUICreate("E-Mail Sender", 465, 280, 192, 124)
$lblReciver = GUICtrlCreateLabel("Empfänger:", 8, 8, 58, 17)
$txtReciver = GUICtrlCreateInput(" ", 80, 8, 217, 21)
$lblSubject= GUICtrlCreateLabel("Betreff:", 8, 35, 58, 17)
$txtSubject = GUICtrlCreateInput('Testnachricht ' & @HOUR & ':' & @MIN & ':' & @SEC , 80, 35, 217, 21)
$lblMsg = GUICtrlCreateLabel("Nachricht:", 8, 68, 53, 17)
$txtMsg = GUICtrlCreateEdit("", 80, 68, 377, 193)
$btnSend = GUICtrlCreateButton("Senden", 312, 8, 145, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $btnSend
sendMsg()
EndSwitch
WEnd
#include <udfblog4itmail.au3>
Func sendMsg()
_blog4itmail(GUICtrlRead($txtSubject), _
$username, _
$sendername, _
GUICtrlRead($txtReciver), _
$smtpserver, _
$username, _
$userpassword)
;_blog4itmail_text(GUICtrlRead($txtMsg))
;_blog4itmail_anhang('c:\boot.ini')
;_blog4itmail_anhang('c:\config.sys')
;_blog4itmail_htmlfromurl('http://blog4it.de');
_blog4itmail_send()
EndFunc
|
|
|
 |
Similar Threads
|
Dateien versenden in C++
11/06/2010 - C/C++ - 6 Replies
Mein problem liegt im Grunde nur darin, dass in der Datei auch "NUL"s enthalten sind. Da die meisten Funktionen Null aber als End Of String kennen, gab es teilweise schon Probleme beim auslesen der Datei, habe es dann aber so gelöst:
FILE * pFile;
pFile = fopen (file.c_str(), "rb" );
string buf;
char c;
do
{
c= fgetc (pFile);
if (!feof(pFile)) buf+=c;
|
C++ Dateien per mail versenden
11/03/2010 - C/C++ - 8 Replies
ich hab mir ein simples spiel erstellt,
ab und zu tauchen auch da fehler
auf. Damit ich die fehler schnell
korrigieren kann soll die log.txt datei
an mich per mail gesendet werden
|
E-Mail-Bestätigun ohne E-Mail Account
03/02/2010 - Tutorials - 14 Replies
Wenn ihr euch zum Bespiel einen neuen Acc auf ner Seite machen wollt, aber die E-Mail schon mal benutzt habt, gibts hier Abhilfe:
1.Gebt auf der Seite, wo ihr euren Acc erstellen wollt, [email protected] an!
http://i48.tinypic.com/b9hb3r.jpg
2. Geht auf mailinator.com und gebt bei "Check your inbox" die E-Mail Adresse an!
http://i48.tinypic.com/2ijlnja.jpg
|
mass-mail versenden?
11/06/2005 - World of Warcraft - 10 Replies
ja, ich geb zu es ist eine etwas komische anfrage, welche u.a. nicht mal mit cheaten zu tun hat :) *sorry*
es geht um folgendes - ich möchte zb. wenn ich in IF bin, alle die sich gerade online befinden und z.b. min lvl56 haben einen brief schicken und diese somit auf einen raid einladen. nach möglichkeit wäre es cool, wenn man alle anschreiben könnte , um zb. längerfristig zu planen. leider ist mir das coden so fremd, wie einer frau das einparken :D . es wäre sehr freundlich, wenn mir...
|
All times are GMT +1. The time now is 16:10.
|
|