Michel Claveau Posted October 16, 2005 Share Posted October 16, 2005 Hi ! Bonsoir ! I had see a script for send email with Blat. J'ai vu, récemment, un script pour envoyer un e-mail avec Blat. Idea : the same thing, with CDO (part of Windows). Cela m'a donné l'idée de faire la même chose avec CDO (intégré à Windows). Here, the code (need AutoIt beta, for COM): Ci-dessous, le code (il faut AutoIt bêta, pour avoir COM) : expandcollapse popup#include <GUIConstants.au3> GUICreate("Email (by CDO)", 400, 350) $posv=10 $posv+=25 GUICtrlCreateLabel ("TO:", 12, $posv+3, 100, 100, -1, -1) $TO = GUICtrlCreateInput ("", 80, $posv, 300, 20) $posv+=25 GUICtrlCreateLabel ("FROM:", 12, $posv+3, 100, 100, -1, -1) $FROM = GUICtrlCreateInput ("", 80, $posv, 300, 20) $posv+=25 GUICtrlCreateLabel ("SUBJECT:", 12, $posv+3, 100, 100, -1, -1) $SUBJECT = GUICtrlCreateInput ("", 80, $posv, 300, 20) $posv+=25 GUICtrlCreateLabel ("BODY:", 12, $posv+3, 100, 100, -1, -1) $BODY = GUICtrlCreateInput ("", 80, $posv, 300, 150, $ES_MULTILINE) $posv+=155 GUICtrlCreateLabel ("Attachment1:", 12, $posv+3, 100, 100, -1, -1) $ATTACHMENT = GUICtrlCreateInput("", 80, $posv, 300, 20) $posv+=45 $CLOSE = GUICtrlCreateButton ("CLOSE", 100, $posv, 75, 20) $SEND = GUICtrlCreateButton ("SEND", 250, $posv, 75, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $CLOSE ExitLoop Case $msg = $SEND Envoi() EndSelect Wend exit Func Envoi() $mel=ObjCreate("CDO.Message") $mel.From=GUICtrlRead($FROM) $mel.To=GUICtrlRead($TO) $mel.Subject=GUICtrlRead($SUBJECT) $mel.Textbody=GUICtrlRead($BODY) $att=GUICtrlRead($ATTACHMENT) if stringlen($att)>0 then $mel.AddAttachment($att) endif $mel.Send() msgbox(0,"Mail","sended.") EndFunc Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted October 17, 2005 Share Posted October 17, 2005 The only problem is that the AddAttachment method requires the full path to the file (unlike vbscript), if it is only a relative path, the @WorkingDir macro must be used... Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
Michel Claveau Posted October 17, 2005 Author Share Posted October 17, 2005 Hi ! Thanks, for the return's infos... Link to comment Share on other sites More sharing options...
Nuffilein805 Posted October 17, 2005 Share Posted October 17, 2005 i just discovered a little problem using your scriptif you just do your code in an empty script and run it, scite gives this msg:line 62 : ==> The requested action with this object has failed.: $mel.Send() $mel.Send()^ ERRORgot a clue why it doesn't work? my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
Michel Claveau Posted October 17, 2005 Author Share Posted October 17, 2005 Hi ! Perhaps: - a field needed is empty? - your SMTP need User+Password? - rights on CDO in too low? Are you administrator? - you are no connect to Internet? - have you a firewall who block CDO? Or other reason that I don't know... I had used the script on only four computers, all on win-XP Have you try with WSH? Or VBscript? For info, I use also Wscite ; but in French, with a config "house". Link to comment Share on other sites More sharing options...
blademonkey Posted October 17, 2005 Share Posted October 17, 2005 (edited) Hi ! Perhaps: - a field needed is empty? - your SMTP need User+Password? - rights on CDO in too low? Are you administrator? - you are no connect to Internet? - have you a firewall who block CDO? Or other reason that I don't know...I had used the script on only four computers, all on win-XPHave you try with WSH? Or VBscript? For info, I use also Wscite ; but in French, with a config "house".Trop cool ton script. Ca fais du bien de lire des postes venant de francophones.Bienvenue a autoit et merci pour ta participation.IE. You rock.-Monkey Edited October 17, 2005 by blademonkey ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
Michel Claveau Posted October 17, 2005 Author Share Posted October 17, 2005 Bonsoir ! Si tu es en France, tu seras peut-être intéressé par les Rencontres-Paradox-Ponx-2005Dans lesquelles je vais présenter plusieurs utilitaires développés avec AutoIt, et utilisables sous Paradox, avec Python, ou en invite de commande.Plus de renseignements ici : Rencontres-Paradox-Ponx-2005@-salutationsMichel Claveau Link to comment Share on other sites More sharing options...
littleclown Posted March 25, 2010 Share Posted March 25, 2010 Michel Claveau its a really really disrespectful to write on your own language!This is an international forum! Link to comment Share on other sites More sharing options...
trancexx Posted March 25, 2010 Share Posted March 25, 2010 Michel Claveau its a really really disrespectful to write on your own language!This is an international forum!You little clown. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
corgano Posted March 26, 2010 Share Posted March 26, 2010 i just discovered a little problem using your scriptif you just do your code in an empty script and run it, scite gives this msg:got a clue why it doesn't work?I got the same message. compiled it and ran as administrator with no luck. Could this be because I am in windows 7? I tried it on an xp comp, but I got the same error (maby it was because I was not admin on there) 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
Hellooopsforgotsendcommand Posted March 29, 2010 Share Posted March 29, 2010 (edited) Michel Claveau its a really really disrespectful to write on your own language!This is an international forum!Yes but the French always think French should be THE language for international discourse.It's all there fault anyway, they helped the USA get independence and it has backfired on them because it's really the US that has made english the world language.Now the French have to speak english, how terrible for them. Edited March 29, 2010 by automatedfaults Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now