Guest Beefteck Posted December 26, 2006 Posted December 26, 2006 (edited) Hello again, I found a working e-mail smtp sender (code below). I need the body of the email to be everything that is entered into TWO input boxes... When a "create account" button is pressed an email is sent to me with the body being filled from text in the 2 input boxes, Here is the E-Mail Sender Code I would like to work with, I suck with variable so.... this is why I came here to ask a better person for help. CODE#cs ---------------------------------------------------------------------------- AutoIt Version: 3.1.1.0 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here $a = "smtp.gmail.com" $b = "****@gmail.com" $c = "***" Emailx("****@gmail.com", "****@rcn.com", "Super Test", "THIS IS WHERE THE BODY TEXT GOES") Func Emailx($d, $e, $f, $g) $h = ObjCreate ("CDO.Message") With $h .Subject = $f .Sender = $d .From = $d .To = $e .TextBody = $g ;.AddAttachment ("C:\Documents and Settings\myname\Desktop\files\file.txt");needs full path- optional EndWith With $h.Configuration.Fields .Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $a .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 .Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $b .Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $c .Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 90 .Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True .Update EndWith $h.Send Return EndFunc;==>Emailx thanks EDIT1: How would i integrate this into a gui???? -Beefteck Edited December 26, 2006 by Beefteck
daslick Posted December 26, 2006 Posted December 26, 2006 It is not your variables.... You have an error of some kind on line 39... "The requested action with this object has failed." Try to get a static piece of code to send an email... then start throwing in variables. I'll see if I can work out the problem.
Guest Beefteck Posted December 26, 2006 Posted December 26, 2006 it works fine the code i gave, it needs to be all valid info for it to work, I tried it with all my stuff and works fine, even with file attachments, I just need the text body to be what is filled into two different input boxes, i will try another way but i still need help with the variables -Beefteck
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