You are here: PSPad forum > České diskuzní fórum > Re: PSmail

Re: PSmail

#1 PSmail

Posted by: lazna | Date: 2016-09-10 21:04 | IP: IP Logged

Kdyz vidim odkaz na program PSmail www.pspad.com , vite o tom ze z windows lze uz asi 15 let odesilat maily BEZ POUZITI EXTERNIHO SW? Nechcete radeji propagovat tuto moznost?

L.

set "vbsfile=bat-email.vbs"
if not exist "%vbsfile%"" call :createVBS
:: defaults
set "fileattach="
set "From=''.phorum_html_encode('box@host.com').''"
set "To=''.phorum_html_encode('box@host.com').''"
set "Subj="This is subject""
set "Body="This is body""
set "Serv=smtp.host.com"
set "AuthEn=0"
set "Auth=user"
set "Pass=pass"
::
call :send %From% %To% %Subj% %Body% %Serv% %Auth% %Pass%
goto :EOF
::
:send
cscript.exe /NOLOGO %vbsfile% %1 %2 %3 %4 %5 %6 %7
goto :EOF
::
:createVBS
del "%vbsfile%" 1>NUL 2>&1
set "cdoSchema=http://schemas.microsoft.com/cdo/configuration"
echo >> "%vbsfile%" Set objArgs = WScript.Arguments
echo >> "%vbsfile%" Set objEmail = CreateObject("CDO.Message")
echo >> "%vbsfile%" objEmail.From = objArgs(0)
echo >> "%vbsfile%" objEmail.To = objArgs(1)
echo >> "%vbsfile%" objEmail.Subject = objArgs(2)
echo >> "%vbsfile%" objEmail.Textbody = objArgs(3)
if defined fileattach echo >> "%vbsfile%" objEmail.AddAttachment "%fileattach%"
echo >> "%vbsfile%" with objEmail.Configuration.Fields
echo >> "%vbsfile%" .Item ("%cdoSchema%/sendusing") = 2 ' not local, smtp
echo >> "%vbsfile%" .Item ("%cdoSchema%/smtpserver") = objArgs(4)
echo >> "%vbsfile%" .Item ("%cdoSchema%/smtpserverport") = 25
echo >> "%vbsfile%" .Item ("%cdoSchema%/smtpauthenticate") = %AuthEn% ' cdobasic
echo >> "%vbsfile%" .Item ("%cdoSchema%/sendusername") = objArgs(5)
echo >> "%vbsfile%" .Item ("%cdoSchema%/sendpassword") = objArgs(6)
echo >> "%vbsfile%" .Item ("%cdoSchema%/smtpusessl") = False
echo >> "%vbsfile%" .Item ("%cdoSchema%/smtpconnectiontimeout") = 25
echo >> "%vbsfile%" .Update
echo >> "%vbsfile%" end with
echo >> "%vbsfile%" objEmail.Send
GOTO:EOF
::
::
GOTO:EOF
::
:END

Options: Reply | Quote | Up ^


#2 Re: PSmail

Posted by: pspad | Date: 2016-10-01 17:31 | IP: IP Logged

Díky za skript.
PSMail je hodne stary nastroj, pouzival jsem jej jeste za dob Windows 9x, kdy jsem z DOS programu pres nej posilal maily.

Options: Reply | Quote | Up ^


#3 Re: PSmail

Posted by: cerny@pavelcerny.cz | Date: 2022-11-18 10:04 | IP: IP Logged

Díky za kod,
mám problém tento script odchází, ale když odremuji objEmail.AddAttachment
hlásí mi chybu "Objekt tuto vlatnost nebo metodu nepodporuje: 'objEmail.AddAttachment'
Nějaká idea proč?
Díky
Pavel

Set objArgs = WScript.Arguments
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "''.phorum_html_encode('test@test.cz').''"
objEmail.To = "''.phorum_html_encode('test@test.cz').''"[img][/img]
objEmail.Subject = "Subj"
objEmail.Textbody = "Teyt"
rem objEmail.AddAttachment = "C:\A\barcelona.txt"
with objEmail.Configuration.Fields
.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' not local, smtp
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "out.smtp.cz"
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "''.phorum_html_encode('test@test.cz').''"
.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "pass**"
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 25
.Update
end with
objEmail.Send

Options: Reply | Quote | Up ^


#4 Re: PSmail

Posted by: pspad | Date: 2022-11-18 10:17 | IP: IP Logged

CDO.Message nemá nic společného s PSPmail, ale nevadí.
Co jsem se díval do dokumentace objektu CDO.Message, tak u attachemntu se nedává rovnítko.

Zkuste pouze:
objEmail.AddAttachment "C:\barcelona.txt"

Options: Reply | Quote | Up ^


#5 Re: PSmail

Posted by: lazna | Date: 2022-11-28 09:30 | IP: IP Logged

pspad:
CDO.Message nemá nic společného s PSPmail, ale nevadí.

Obojí jsou nástroje pro odesílání mailů z windows

Options: Reply | Quote | Up ^


#6 Re: PSmail

Posted by: pspad | Date: 2022-11-28 11:16 | IP: IP Logged

S tím rozdílem, ze PSMail je moje utilitka winking smiley

Options: Reply | Quote | Up ^


#7 Re: PSmail

Posted by: lazna | Date: 2022-11-30 11:04 | IP: IP Logged

To chápu, asi jsem zvolil blbý subjekt vlákna sad smiley

Edited 1 time(s). Last edit at 2022-11-30 11:05 by lazna.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2022 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR