Jump to content

Variable send?

Guest Beefteck

Recommended Posts

Guest Beefteck

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.

#cs ----------------------------------------------------------------------------

AutoIt Version:

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


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







EDIT1: How would i integrate this into a gui????


Edited by Beefteck
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Guest Beefteck

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


Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...