Sign in to follow this  
Followers 0
lifesux

E-Mail Sender ( Gmail )

15 posts in this topic

I want to write a script to send e mail.

Where is the error ?

#Include<file.au3>
#include <INet.au3>
#include <GUIConstants.au3>
#include <array.au3>
$SmtpServer = "smtp.gmail.com"          
$FromName = "deneme"                    
$FromAddress = "xxxxxxxx.com"
$ToAddress = "xxxxxxxx.com"  
$Subject = "test"                 
$Body = "test"                          
$AttachFiles = ""                     
$CcAddress = ""   
$BccAddress = ""    
$Importance = "High"                
$Username = "wxxxxxxxxx"                  
$Password = "xxxxxxxxxx"                
$IPPort=465                     
$ssl=1

Share this post


Link to post
Share on other sites



Where is the error ?

Looks to me like you never actually send the mail. You just assign variables that define the contents of the mail.

Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Looks to me like you never actually send the mail. You just assign variables that define the contents of the mail.

lol yes :/ So how can i send ???

trying this but not working

_INetSmtpMail($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject & "", $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
Edited by lifesux

Share this post


Link to post
Share on other sites

Thanks for everything guys ! Now its work perfect but i have 1 more question about guictrl read. Here is my code :

$SmtpServer = "smtp.gmail.com"
$FromName = "xxx"
$FromAddress = "xxxx"
$ToAddress = "xxxx"
$Subject = "xxxxx"
$Body = ""GUICtrlRead($Input1)","GUICtrlRead($Input2)","GUICtrlRead($Input3)""
$AttachFiles = ""
$CcAddress = ""
$BccAddress = ""
$Importance = "High"
$Username = "xxxx"
$Password = "xxxx"
$IPPort=465
$ssl=1
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  
  Case $Button2
   Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)

Its not working with guictrlread ??? ( at body part )

Thanks for your help...

Share this post


Link to post
Share on other sites

What are those double quotes for around the function?

Load the full version of SciTE4AutoIt3 to ensure au3check is ran each time you press F5 which will give you the syntax errors.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

What are those double quotes for around the function?

Load the full version of SciTE4AutoIt3 to ensure au3check is ran each time you press F5 which will give you the syntax errors.

i deleted quotes but its not working :)

Share this post


Link to post
Share on other sites

i deleted quotes but its not working :)

Did you do what I suggested?

.. and we are pretty bad in the area of clairvoyance so post your whole script if you want to hear more than a dozen of guesses.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Did you do what I suggested?

.. and we are pretty bad in the area of clairvoyance so post your whole script if you want to hear more than a dozen of guesses.

yes i do. i pressed f5 and it show where is the error. i know that .

its my full code :

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#Include <WinAPI.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <file.au3>
#include <INet.au3>
#include <smtp.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("xxxxx", 398, 324, 297, 182)
$Button1 = GUICtrlCreateButton("xxxxx ", 16, 248, 169, 65, $WS_GROUP)
$Button2 = GUICtrlCreateButton("xxxx", 208, 224, 177, 97, $WS_GROUP)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Input1 = GUICtrlCreateInput("xxxx", 8, 88, 193, 24)
$Input2 = GUICtrlCreateInput("xxxx", 8, 128, 193, 24)
$Input3 = GUICtrlCreateInput("xxxxx", 8, 160, 193, 24)
$List1 = GUICtrlCreateList("", 8, 192, 193, 22)
GUICtrlSetData(-1, "xxxx")
GUICtrlSetTip(-1, "xxxxx")
$Label1 = GUICtrlCreateLabel("xxxxx", 32, 16, 320, 33)
GUICtrlSetFont(-1, 15, 800, 0, "MS Sans Serif")
$Pic1 = GUICtrlCreatePic("xxxxx", 216, 64, 153, 145, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$SmtpServer = "smtp.gmail.com"
$FromName = "xxx"
$FromAddress = "xxxx"
$ToAddress = "xxxx"
$Subject = "xxxxxx"
$Body ="GUICtrlRead($Input1)","GUICtrlRead($Input2)","GUICtrlRead($Input3)"
$AttachFiles = ""
$CcAddress = ""
$BccAddress = ""
$Importance = "High"
$Username = "xxx"
$Password = "xxxx"
$IPPort=465
$ssl=1
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  Case $Button1
  
  Case $Button2
   Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
  Case $List1
EndSwitch
WEnd

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Still see the double quotes around the GuiCtrlRead() function so that means it is just treated as a literal string.

When you want to concatenate the 3 input boxes then it should read:

$Body = GUICtrlRead($Input1) &GUICtrlRead($Input2) & GUICtrlRead($Input3)

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Still see the double quotes around the GuiCtrlRead() function so that means it is just treated as a literal string.

When you want to concatenate the 3 input boxes then it should read:

$Body = GUICtrlRead($Input1) &GUICtrlRead($Input2) & GUICtrlRead($Input3)

thanks it read but not i want. it send the xxxx not the thing the user write ???

Share this post


Link to post
Share on other sites

thanks it read but not i want. it send the xxxx not the thing the user write ???

Yea ... I understand it does that. It would be helpfuff went you try to understand what your are doing in stead of simply posting each and every problem you have.

You need to fill the $Body field with the GUICtrlRead() commands AFTER they are filled in and just BEFORE you send the email.

Again, try to understand the code.

What are you going to use this code for?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Yea ... I understand it does that. It would be helpfuff went you try to understand what your are doing in stead of simply posting each and every problem you have.

You need to fill the $Body field with the GUICtrlRead() commands AFTER they are filled in and just BEFORE you send the email.

Again, try to understand the code.

What are you going to use this code for?

Jos

So, how can i do that :) Sorry for my questions but i am new ;)

Edited by lifesux

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

What are you going to use this code for?

:)

In my opinion, automating the sending of emails is a dodgy subject and one that ranks up there with the automation of websites.

Besides: Google's GMAIL terms of use:

5. Use of the Services by you

5.3 You agree not to access (or attempt to access) any of the Services by any means other than through the interface that is provided by Google, unless you have been specifically allowed to do so in a separate agreement with Google. You specifically agree not to access (or attempt to access) any of the Services through any automated means (including use of scripts or web crawlers) and shall ensure that you comply with the instructions set out in any robots.txt file present on the Services.

Expressly forbids the use of scripts to automate email through their service.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

So, how can i do that :) Sorry for my questions but i am new ;)

Again.. learn to script/program first, else this tools is going to hurt more then it helps you.

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0