Jump to content

INet mail sending problem


MirnesC2
 Share

Recommended Posts

I used both the smpt and regular mail examples from the help files and neither worked.

#include <INet.au3>

$s_SmtpServer = "smtp.gmail.com"
$s_FromName = "Mirnes"
$s_FromAddress = "MirnesC92@gmail.com"
$s_ToAddress = "MirnesC92@gmail.com"
$s_Subject = "My Test UDF"
Dim $as_Body[2]
$as_Body[0] = "Testing the new email udf"
$as_Body[1] = "Second Line"
$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
$err = @error
If $Response = 1 Then
    MsgBox(0, "Success!", "Mail sent")
Else
    MsgBox(0, "Error!", "Mail failed with error code " & $err)
EndIf

Returns error msg 50 with no email sent.

#include <INet.au3>

$Address = InputBox('Address', 'Enter the E-Mail address to send message to') ;mirnesc92@gmail.com
$Subject = InputBox('Subject', 'Enter a subject for the E-Mail') ;test
$Body = InputBox('Body', 'Enter the body (message) of the E-Mail') ;test
MsgBox(0,'E-Mail has been opened','The E-Mail has been opened and process identifier for the E-Mail client is ' & _INetMail($address, $subject, $body))

Returns 0 for failure, no email sent

Link to comment
Share on other sites

  • Developers

GMail doesn't allow standard smtp connections.

Look for _InetSMTPMailCom() in the Examples forum that does support GMail.

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

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...