Batch-Datei auf E-Mail-Anhang senden:Datei verschieben, um einen anderen Ordner und den Ordner URL
@echo off
set source=D:\teste
set target=D:\trab
for /F "delims=" %%I in ('dir %source%\*.* /A:-D /O:D /B') do move %source%\%%I %target% & echo %%I %source%\%%I & goto :continue
:continue
set p/ AttachmentFullName=%target%\<<fileName.txt>>
cscript.exe //NoLogo "D:\partilhas\correo.vbs" %AttachmentFullName%
timeout 20
VBScript-Datei:
Set objMail = CreateObject("CDO.Message")
Set objConf = CreateObject("CDO.Configuration")
Set objFlds = objConf.Fields
Dim attachmentFullName
attachmentFullName = WScript.Arguments.Named("%AttachmentFullName%")
objFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoSendUsingPort
objFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.SMTP.com"
objFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'objFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "NAME"
'objFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PWS"
'objFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'cdoBasic
objFlds.Update
objMail.Configuration = objConf
objMail.From = "[email protected]"
objMail.To = "[email protected]"
objMail.Subject = "Email Subject Text"
objMail.AddAttachment attachmentFullName
objMail.TextBody = "The message of the email..."
objMail.Send
Set objFlds = Nothing
Set objConf = Nothing
Set objMail = Nothing
Was ich will, ist die Datei von einem Ordner ältesten bis neuesten bekommen eins nach dem anderen und sende eine E-Mail mit jedem Anhang. Als Dateinummer die gleiche Mail-Nummer senden und gleich oft verschieben. Jemand Hilfe?
Es funktioniert, aber nur eine Datei an andere Ordner und eine E-Mail gesendet und ich möchte alle Dateien an andere Ordner und die gleiche Anzahl von Anlagen in E-Mails gesendet – djva