Sign in to follow this  
Followers 0
ken82m

Need Help with a small _INetSmtpMail Mod

1 post in this topic

#1 ·  Posted (edited)

I know there are some newer smtp mailers out there.

But I want one with a visual output and none of the others I found have it.

In this case the trace parameter on _INetSmtpMail.

I've just been trying to add authentication to the UDF.

The username is sent and it gets a 335 reply, I can't even find 335 anywhere so not sure what it means.

But if I manually launch a telnet session and put in the exact base64 string being generated it works fine.

Posted Image

I know I haven't destroyed the UDF's functionality since messages send fine without the username and password.

Example using modified UDF:

#include "Array.au3"
#include "Date.au3"
#include "InetMod.au3"
;#include "Base64.au3" ;Func inluded in UDF for testing

$TimeDate = _Date_Time_SystemTimeToDateTimeStr($tSystemTime)
$s_SmtpServer = "smtp.somewhere.com"
$s_FromName = "Test Name"
$s_FromAddress = "Tesuser@nowhere.com"
$s_ToAddress = "Destination@nowhere.com"
$s_Subject = "SMTP Test Message" & $TimeDate
Dim $as_Body[1]=[ "SMTP Test " & $TimeDate ]
$s_Username = "testusername"
$s_Password = "testpassword"


;Ends with error code 51
$Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_Username, $s_Password, "", -1, 1)
$err = @error
If $Response = 1 Then
    MsgBox(262144, "Success!", "Authenticated Mail sent")
Else
    MsgBox(262144, "Error!", "Authenticated Mail failed with error code " & $err)
EndIf

;username/password null, mail sent.
$Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, "", "", "", -1, 1)
$err = @error
If $Response = 1 Then
    MsgBox(262144, "Success!", "Mail sent")
Else
    MsgBox(262144, "Error!", "Mail failed with error code " & $err)
EndIf

InetMod.au3

InetMod.au3

Edited by ken82m

My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

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