Sign in to follow this  
Followers 0
Leopardfist

_INetSmtpMail example wont even work for me

8 posts in this topic

#1 ·  Posted (edited)

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

Share this post


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


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

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.

Share this post


Link to post
Share on other sites

tried it with smtp.live.com to which is hotmail smtp, same error. can anyone put up an email server this udf WILL work with?

Share this post


Link to post
Share on other sites

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


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

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 

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


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

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
Sign in to follow this  
Followers 0