Jump to content

_INetSmtpMail example wont even work for me


Recommended Posts

I am just trying to use the example script in the help file, and adding in my smtp info, but I get error 50, which according to the help file 5x means it couldnt open the smtp session.

#include <Inet.au3>

Local $s_SmtpServer = "smtpout.secureserver.net"
Local $s_FromName = "Bill"
Local $s_FromAddress = "**************"
Local $s_ToAddress = "**************"
Local $s_Subject = "My Test UDF"
Local $as_Body = "Testing smtp mailer"
Local $Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject)
Local $err = @error
If $Response = 1 Then
    MsgBox(0, "Success!", "Mail sent")
Else
    MsgBox(0, "Error!", "Mail failed with error code " & $err)
EndIf

There is no parameter for the smtp server username & password, is that not needed? 

Edited by Leopardfist
Link to comment
Share on other sites

  • Developers

This UDF doesn;t work with secure SMTP.

You could try the UDF _INetSmtpMailCom  I wrote that works with secure email of Gmail and Yahoo, so could also work with this one.

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

This UDF doesn;t work with secure SMTP.

You could try the UDF _INetSmtpMailCom  I wrote that works with secure email of Gmail and Yahoo, so could also work with this one.

Jos

 

Hi, thanks Jos, I tried yours first, but it required everyone who ran the program to have the CDO installed, therefor I got COM errors. I just want to send mail, WHICH mail server WILL this work on? I can change email servers used for sending.

Link to comment
Share on other sites

  • Developers

You won't find any public open smtp servers that run conventional port 25 SMTP without security due to it being open to spammers.

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

thanks Jos, kind of renders this function useless seems to me.

May I ask, is there ANYWAY to do an autoit code that will send an email, without the need for the end user to download particular libraries like the CDO one? Is it possible for me to have my program simply send the email arguement to a php file on my server, to trigger that php file to send the email using the email in the arguement? Maybe simple PHPMail typ ething?

I just want my program to send the email from the end user when they register it. XProTec seemed wonderful uintil my first two testers BOTH had COM failures 

Link to comment
Share on other sites

As I already suggested: use Blat. This can be packed into your script and FileInstalled when needed.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Water is right. Blat is the most simple to use. Your issue may be that your ISP has blocked traffic going out on port 25 (the SMTP port). Try settings your port to 587, or if necessary, call your ISP and ask them to unblock it. If you are on a business subscription, they will probably unblock it for you. Otherwise, look at using a secure email server. You could still use blat, coupled with a program called "stunnel."

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