Jump to content

Smtp Mailer That Supports Html And Attachments.


Jos
 Share

Recommended Posts

Is this a bug?

If Number($IPPort) = 0 Then $IPPort = 25

Should it be:

If IsNumber($IPPort) = 0 Then $IPPort = 25

Well, ok, I think I understand. If someone supplies a string then it gets converted to an int?

Ok, I experimented with this:

$Result = Number(42)
MsgBox(0, "Number", $Result)
MsgBox(0, "VarType", VarGetType($Result))

$Result = Number("42")
MsgBox(0, "Number", $Result)
MsgBox(0, "VarType", VarGetType($Result))

$Result = Number("a")
MsgBox(0, "Number", $Result)
MsgBox(0, "VarType", VarGetType($Result))

Which seems to support my conclusion.

Edited by jaberwocky6669
Link to comment
Share on other sites

  • Developers

Is this a bug?

If Number($IPPort) = 0 Then $IPPort = 25

Should it be:

If IsNumber($IPPort) = 0 Then $IPPort = 25

Not sure what the issue is you are having and are trying to solve?

The current If makes sure that the supplied $IPPort is a valid number not equals to zero to ensure a proper port number is supplied to the CDO.

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

I want to thanks Jos because his smtp mail script solved a great problem for me.

I was using another script for smtp mailing, but that script ceased to function with version of Windows above XP.

So I start to use the "native" function of autoit _INetSmtpMail , that is ok for normal mail.

But I have to send SMS (short messages) with an appliance by Quescom, (an ip device with some SIMs capable of making calls and send SMSs).

This device accept to send SMS if it receive an email using :

server : the ip of the device

from address : indifferent

to address: gateway@quescom.it

subject : indifferent

body of the mail: SMS=333888999 TEXT=my short message.

You can of course configure Outlook and thunderbird and start to send SMS

But _INetSmtpMail wan't work.

The mail is sent, smtp trace all OK, but the sms is not sent, I know the Quescom and for me the body is not correct

I suspect that _INetSmtpMail add some tipe of character(s) in the body of the mail, but I don't know how to resolve this.

By now I use your script Jos.

Greetz

Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...

I am removing the content of my original post as I have resolved the while/wend issues I was having.

However, I do now have a question about how the $body variable can have multiple values. I am trying to build a multiple line email with variables pulled from a csv file. This all works fine using a different inetsmtp function and $as_body[#] where # = number of lines required in email body and then declaring each line as $as_body[1] = and so on.

Doesnt seem to work with this method causes a com error

any ideas?

many thanks

Tony

Edited by tcb
Link to comment
Share on other sites

  • Developers

However, I do now have a question about how the $body variable can have multiple values. I am trying to build a multiple line email with variables pulled from a csv file. This all works fine using a different inetsmtp function and $as_body[#] where # = number of lines required in email body and then declaring each line as $as_body[1] = and so on.

Use your own $body_array and at sent time simply do:

$body = _ArrayToString($body_array, @crlf)

Jos

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

Jos, you are gent!!

thanks

being increasingly cheeky, is it possible to have images embedded with the email as well? I know I can add body array lines that refer to a web address for the png file, but i would prefer to send it with the email itself.

Thanks

Tony

Link to comment
Share on other sites

  • Developers

being increasingly cheeky, is it possible to have images embedded with the email as well? I know I can add body array lines that refer to a web address for the png file, but i would prefer to send it with the email itself.

Thanks

Tony

Referencing an external image would be easy in an HTML body, but incorporating one will require to adapt the UDF.

Maybe this article can help you with that: http://support.jodohost.com/showthread.php?t=7692

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

  • 1 month later...

This might be a stupid question but it is somthing that has been puzzling me. How do I make have more then one two address is it a , that divides them or what everything else tells you in the comment to the right except the to variable.

Please help and thank you in advance.

Link to comment
Share on other sites

As your ISP or Mail Service Provider.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

  • 3 weeks later...

Can someone do a example for hotmail (stmp.live.com) because I have tried many times over messing with the settings and cannot get it to work at all I get a error 2.

I am using port 25 and I have tried using ssl set to 0 and 1 and tried username & password and changed everything but it refuses to work.

I am using code in first post reason for not posting source is no need since I dont know what settings to post in my example since I tried so many :)

Edited by SkellySoul
Link to comment
Share on other sites

  • Developers

Found this info somewhere on the internet so that should be pretty straightforward assuming it works... so have you tried this?

To setup mail client to access Windows Live Hotmail account, use the following Hotmail POP3 and SMTP configuration settings:

Incoming Server (POP3 Server): pop3.live.com

Incoming Server POP Port: 995

Incoming Server POP SSL Encryption: Yes (On or Required)

Outgoing Server (SMTP Server): smtp.live.com

Outgoing Server SMTP Port: 25

Outgoing Server Authentication: Yes (On – Use POP username and password or Hotmail credentials)

Outgoing Server TLS or SSL Secure Encrypted Connection: Yes (On or Required)

Tip (by J): Outgoing Server of Hotmail also supports port 587, useful for people who encounters error for STMP due to ISP blockage or any other reason.

So my guess would be but can't test:

$SmtpServer = "smtp.live.com"       ; address for the smtp-server to use - REQUIRED
$Username = "hotmail account"           ; username for the account used from where the mail gets sent - REQUIRED
$Password = "hotmail password"          ; password for the account used from where the mail gets sent - REQUIRED
$IPPort = 25  ; or 587                  ; port used for sending the mail
$ssl = 1                        ; enables/disables secure socket layer sending - put to 1 if using httpS

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

The security for this can't be good.

I mean if i want it to send an email to me with attachmen. With a new created email with usr and pw in the code.

1. Anyone can sniff the traffic, and maybe take my usr and pw. And do what they want.

2. Anyone can decompile my program which is easy to do, and take my usr and pw.

So how can i secure this?

I know that it's possible to send emails with php without using any passwords or usernames.

Just using a email address and then send it.

Link to comment
Share on other sites

  • Developers

The security for this can't be good.

I mean if i want it to send an email to me with attachmen. With a new created email with usr and pw in the code.

1. Anyone can sniff the traffic, and maybe take my usr and pw. And do what they want.

2. Anyone can decompile my program which is easy to do, and take my usr and pw.

So how can i secure this?

I know that it's possible to send emails with php without using any passwords or usernames.

Just using a email address and then send it.

Decompile I agree but sniffer ->nope.

You know what $SSL=1 will do?

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

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