Jump to content

Using _INetMail with attachments


NSearch
 Share

Recommended Posts

Maybe you can try something like this....

$objMessage = ObjCreate("CDO.Message")
$objMessage.From = "nobody@nobody.com"
$objMessage.To = "nobody@nobody.com"
$objMessage.Subject = "Test"
$objMessage.TextBody = "Test"
$objMessage.AddAttachment(@ScriptDir & "\Test.txt")
$objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
$objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "your providers smtp"
$objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
$objMessage.Configuration.Fields.Update
$objMessage.Send

Sapiente vince, rex, noli vincere ferro!

Link to comment
Share on other sites

Just a note, the AddAttachment method requires that the parameter be the exact path to a file (not relative).

@WorkingDir & '\file.txt' may be a more appropriate approach depending upon your situation

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

  • 3 weeks later...

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