Sign in to follow this  
Followers 0
Daniza

_INetSmtpMailCom

8 posts in this topic

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.

Share this post


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

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.

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

 

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

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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.

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