Smtp Mailer That Supports Html And Attachments.

658 posts in this topic

#21 ·  Posted (edited)

Hi guys when I tried to use the code I had error

$ObjEmail.Send

$ObjEmail.Send^ERROR

Error: The requested action with this object has failed.

PS.Sorry to rise up all threads.

You didn't use the Com error handler portion of the posted code..

That should tell you more about why the send fails....

Edited by JdeB

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

Share this post


Link to post
Share on other sites



#22 ·  Posted

I'm having problems with this, I have this in the code:

$rc = _INetSmtpMailCom("smtp.mail.yahoo.com", "name", "email1@yahoo.ca", "email2@yahoo.ca", "subject", "message", "", "","", "email1username", "email1password")

I get error :

Error code:2 Description:The transport failed to connect to the server

Any help is appreciated, thanks

Share this post


Link to post
Share on other sites

#23 ·  Posted

I'm having problems with this, I have this in the code:

$rc = _INetSmtpMailCom("smtp.mail.yahoo.com", "name", "email1@yahoo.ca", "email2@yahoo.ca", "subject", "message", "", "","", "email1username", "email1password")

I get error :

Error code:2 Description:The transport failed to connect to the server

Any help is appreciated, thanks

Does it work when you use the same Servername/Userid/Password in outlook express ?

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

Share this post


Link to post
Share on other sites

#24 ·  Posted

Great script, I do have one minor question. When I beta run the script I keep getting an error "C:\Program Files\AutoIt3\beta\Autoemail.au3(34,65) : ERROR: _PathFull(): undefined function.

$S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])"

The script will complete and run fine even including the attachment when there is one, just looking for some illumination as to what I might have incorrect.

Thanks in Advance,

Badger

Share this post


Link to post
Share on other sites

#25 ·  Posted

Great script, I do have one minor question. When I beta run the script I keep getting an error "C:\Program Files\AutoIt3\beta\Autoemail.au3(34,65) : ERROR: _PathFull(): undefined function.

$S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])"

The script will complete and run fine even including the attachment when there is one, just looking for some illumination as to what I might have incorrect.

Thanks in Advance,

Badger

You probably get an error when running from SciTE ?

Done any updates lately for SciTE?


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

Share this post


Link to post
Share on other sites

#26 ·  Posted

You probably get an error when running from SciTE ?

Done any updates lately for SciTE?

Thank you, that was the problem.

Badger

Share this post


Link to post
Share on other sites

#27 ·  Posted (edited)

#Include <smtp.au3>
$s_SmtpServer = "smtp.gmail.com"
$s_FromName = "Azkay"
$s_FromAddress = "Azkay@gmail.com"
$s_ToAddress = "azkay-s@hotmail.com"
$s_Subject = "Okay"
$as_Body = "Test."
$s_AttachFiles = ""
$s_CcAddress = ""
$s_BccAddress = ""
$s_Username = "azkay.s@gmail.com"
$s_Password = "mypass"
_INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password)
Exit

I get error 1. Why?

EDIT::

### COM Error !  Number: 80020009   ScriptLine: 51   Description:The transport failed to connect to the server.
Edited by AzKay

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

#28 ·  Posted (edited)

I get error 1. Why?

EDIT::

### COM Error !  Number: 80020009   ScriptLine: 51   Description:The transport failed to connect to the server.
Google uses port 465 and SSL

try it with this version of _InetSmtpMailCom and add the last parameters with 465 and 1.

Moved updated script to first post...

Edited by JdeB

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

Share this post


Link to post
Share on other sites

#29 ·  Posted

Gmail uses SSL security, might be the issue...


Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Share this post


Link to post
Share on other sites

#30 ·  Posted

Wow, Very nice! Works. ^^, You have no idea how happy I am, Ive been looking for something like this in over a year, I tryed looking with different languages, none worked, but now ^^.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

#31 ·  Posted (edited)

This is really frustrating me, I can't get this to work, there has to be something that I am missing.

global $oMyError = ObjEvent("AutoIt.Error","MyErrorFunc")

_INetSmtpMailCom("smtp.google.com", guictrlread($sender), "mygmailaccount@gmail.com", "abcd@efg.com", "Feedback from: " & guictrlread($sender) , guictrlread($emailbody), "", "", "", "mygmailaccount", "mygmailpassword",465, 1)

oÝ÷ Ù©Ý"G¦­¶)ඬyê뢻ºÚ"µÍÐTSÎ ÌÍÛÓ^T]ÜÜÚXHÙYYÜHXÛ][Û]  ÌÍÛÓ^T]ÌWBLJHOIÝÈH]YÝYXÝ[ÛÚ]ÈØXÝÈZ[YÌÍÛØ[XZ[Ù[ÌÍÛØ[XZ[Ù[

there has to be something obvious that I am missing. I know that $omyret[1] has to be declared, but how and where?

and why isn't the error handler working properly?

[edit]

I am running latest beta, and the latest update for scite4

Edited by orange

Share this post


Link to post
Share on other sites

#32 ·  Posted

I installed the BETA, but when I compile the script I get a lot of errors:

C:\email.au3(3,14) : ERROR: syntax error (illegal character)
    $objEmail.
~~~~~~~~~~~~~^
C:\email.au3(7,41) : ERROR: syntax error (illegal character)
    If $s_CcAddress <> "" Then $objEmail.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\email.au3(8,42) : ERROR: syntax error (illegal character)
    If $s_BccAddress <> "" Then $objEmail.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\email.au3(11,18) : ERROR: syntax error (illegal character)
        $objEmail.
~~~~~~~~~~~~~~~~~^
C:\email.au3(13,18) : ERROR: syntax error (illegal character)
        $objEmail.
~~~~~~~~~~~~~~~~~^
C:\email.au3(20,26) : ERROR: syntax error (illegal character)
                $objEmail.
~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\email.au3(28,14) : ERROR: syntax error (illegal character)
    $objEmail.
~~~~~~~~~~~~~^
C:\email.au3(33,18) : ERROR: syntax error (illegal character)
        $objEmail.
~~~~~~~~~~~~~~~~~^
C:\email.au3(38,18) : ERROR: syntax error (illegal character)
        $objEmail.
~~~~~~~~~~~~~~~~~^
C:\email.au3(41,14) : ERROR: syntax error (illegal character)
    $objEmail.
~~~~~~~~~~~~~^
C:\email.au3(43,14) : ERROR: syntax error (illegal character)
    $objEmail.
~~~~~~~~~~~~~^
C:\email.au3(46,26) : WARNING: $oMyRet: possible used before declaration.
        return $oMyRet[1]
~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\email.au3(53,31) : ERROR: syntax error (illegal character)
    $HexNumber = Hex($oMyError.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\email.au3(55,41) : ERROR: syntax error (illegal character)
    $oMyRet[1] = StringStripWS($oMyError.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\email.au3(56,90) : ERROR: syntax error (illegal character)
    ConsoleWrite("### COM Error !  Number: " & $HexNumber & "   ScriptLine: " & $oMyError.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\email.au3(2,40) : ERROR: ObjCreate(): undefined function.
    $objEmail = ObjCreate("CDO.Message")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\email.au3(18,65) : ERROR: _PathFull(): undefined function.
            $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\email.au3 - 16 error(s), 1 warning(s)

Does anyone know how to fix this?

Share this post


Link to post
Share on other sites

#33 ·  Posted (edited)

Sorry for kicking so quickly, but does anyone know this? I can't figure out what's wrong, but I would like to finish my script which needs this smtp script. Thanks in advance!

Edited by Carl

Share this post


Link to post
Share on other sites

#34 ·  Posted

how are you compiling it

if you're doing from context menu then you're still not using beta

start menu

AutoIt v3\beta\Compile Script to .exe (beta)


Share this post


Link to post
Share on other sites

#35 ·  Posted

How do u use this.....please make a guide to show you what you have to write in every variable...because it gives me lots of errors and I donno how to use this...:whistle:

Share this post


Link to post
Share on other sites

#36 ·  Posted

How do u use this.....please make a guide to show you what you have to write in every variable...because it gives me lots of errors and I donno how to use this...:whistle:

A guide? LOL, there already is one... It's called the help file... A suggestion is that if you can't get this to work (you're v3.1.1 is outdated (v.3.2 is released)).

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#37 ·  Posted (edited)

How do u use this.....please make a guide to show you what you have to write in every variable...because it gives me lots of errors and I donno how to use this...:whistle:

Wouldn't it be a lot easier when you show us what you have and what errors you get ?

We can then help you fix it but only if you promise to write that manual for this UDF after you got things working ... Deal ?

Edited by JdeB

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

Share this post


Link to post
Share on other sites

#38 ·  Posted

I allready have the latest beta....ok the errors were because i changed something in the script...now it's fine but still can't send mail...

Share this post


Link to post
Share on other sites

#39 ·  Posted

I allready have the latest beta....ok the errors were because i changed something in the script...now it's fine but still can't send mail...

Did you see the post just above your last post ?

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

Share this post


Link to post
Share on other sites

#40 ·  Posted

I do not get any errors now...but I need to know what to write in every variable...because it doesen't send any mail...

Share this post


Link to post
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