Jump to content

_INetSmtpMailCom


Recommended Posts

Hello guys! (off for summer vacation)  Need some advice I need to attach all content of the folder, I know how to attach single files but I don't see examples on search or help file how to attach all folder content.  :ermm: 

$AttachFiles = "C:\img\vacationtrip.htm" ; "C:\gilva-img"

I attach to files the vacation trip and I need to attach the full folder of C:gilva-img I don't think if I tweak it right.

Link to comment
Share on other sites

According to the description in Jos' script: "the file(s) you want to attach seperated with a ; (Semicolon)".

So: Create a string containing all files you want to attach separated by ;

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

Somewhat like this

#include <File.au3>
#include <Array.au3>

$aFiles = _FileListToArray("C:\gilva-img")
$sPath = _ArrayToString($aFiles, ";")
MsgBox(64, "The path to be passed", $sPath)

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

According to the description in Jos' script: "the file(s) you want to attach seperated with a ; (Semicolon)".

So: Create a string containing all files you want to attach separated by ;

 

Oh my, i have 50+ pictures stored in that folder, and I should do it individual like img1.jpg; img2.jpg; and so on..  :ermm: I think it is not possible to just attach the folder thanks Water for quick response.

Link to comment
Share on other sites

 

Somewhat like this

#include <File.au3>
#include <Array.au3>

$aFiles = _FileListToArray("C:\gilva-img")
$sPath = _ArrayToString($aFiles, ";")
MsgBox(64, "The path to be passed", $sPath)

 

Sir Phoenix you mean like this 

#include <File.au3>
#include <Array.au3>

$aFiles = _FileListToArray("C:\gilva-img")
$sPath = _ArrayToString($aFiles, ";")

$AttachFiles = "C:\img\vacationtrip.htm" ; "$sPath"

I'm still on learning code's im gonna gave it a shut thank's Phoenix  :sweating: 

Link to comment
Share on other sites

Yup

#include <File.au3>
#include <Array.au3>

$aFiles = _FileListToArray("C:\gilva-img")
$sPath = _ArrayToString($aFiles, ";")
MsgBox(64, "The path to be passed", $sPath)

;Link - http://www.autoitscript.com/forum/topic/23860-smtp-mailer-that-supports-html-and-attachments/
;_INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
_INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = $sPath)

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

 

Yup

#include <File.au3>
#include <Array.au3>

$aFiles = _FileListToArray("C:\gilva-img")
$sPath = _ArrayToString($aFiles, ";")
MsgBox(64, "The path to be passed", $sPath)

;Link - http://www.autoitscript.com/forum/topic/23860-smtp-mailer-that-supports-html-and-attachments/
;_INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
_INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = $sPath)

 

I think it does'nt detect the right path if only the name's of the file will be log, it look's like example img1.jpg;img2.jpg but it should be C:gilva-imgimg1.jpg;C:gilva-imgimg2.jpg, how can i put the C:gilva-img before the file name?  :ermm:

 

Edited by Gilva
Link to comment
Share on other sites

Recommended way - For Next Loop with an Array - must be learnt for easy coding

#include <File.au3>
#include <Array.au3>

$aFiles = _FileListToArray("C:\gilva-img")

;recommended if you are a begginer
For $i = 0 To UBound($aFiles) - 1
    $aFiles[$i] = "C:\gilva-img\" & $aFiles[$i]
Next

$sPath = _ArrayToString($aFiles, ";")


MsgBox(64, "The path to be passed", $sPath)

;Link - http://www.autoitscript.com/forum/topic/23860-smtp-mailer-that-supports-html-and-attachments/
;_INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
_INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = $sPath)

Regular Expression way - format the string - check this if you know about regex.

#include <File.au3>
#include <Array.au3>

$aFiles = _FileListToArray("C:\gilva-img")
$sPath = _ArrayToString($aFiles, ";")

;regex way
$sPath = StringRegExpReplace($sPath, "([\A;])([^;]+)", "\1C:\\gilva-img\\\2")

MsgBox(64, "The path to be passed", $sPath)

;Link - http://www.autoitscript.com/forum/topic/23860-smtp-mailer-that-supports-html-and-attachments/
;_INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
_INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = $sPath) 

Regards ;)

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

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