Rank: Newbie
Groups: Registered
Joined: 2/19/2020(UTC)
Posts: 0
Location: Leeds
Hey Guys,
When using the following code:
Code: $mail.AddAttachment = "C:\LocalPathTo\my.log"
I seem to be getting the following error returned in the console:
Code: Failed to send email: Cannot set the Value property for PSMemberInfo object of type "System.Management.Automation.PSMethod".
In addition I have also noticed this issue when attaching .jpg/.png files but I did get it to work in my initial tests with a PDF.
I doubt it has anything to do with size as the files that I am trying to attach are just .log files with a size of aprox' 100kb
I can't seem to find any mention of this error in regards to EASendMail online so a bit of help on what to look out for would be much appreciated.
p.s. If you haven't guessed by the $ I am working with PowerShell don't know if that makes a difference but thought I'd mention it in case the protocols are different etc.
Thanks,
Maisy
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,153
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
AddAttachment is method, not a property, the correct syntax is:
Code:
$mail.AddAttachment("C:\LocalPathTo\my.log")
Rank: Newbie
Groups: Registered
Joined: 2/19/2020(UTC)
Posts: 0
Location: Leeds
Ah sweet thanks, can't believe I overlooked that one! It's working now thanks! Regards, Maisy
Forum Jump
EmailArchitect Support
Email Component Development
- EASendMail SMTP Component - .NET Version
- EASendMail SMTP Component - Windows Store Apps
- EASendMail SMTP ActiveX Object
- EAGetMail POP3 & IMAP4 Component - .NET Version
- EAGetMail POP3 & IMAP4 ActiveX Object
Exchange Server and IIS SMTP Plugin
- DomanKeys/DKIM for Exchange Server and IIS SMTP
- Disclaimer and S/MIME for Exchange Server and IIS
EmailArchitect Email Server
- EmailArchitect Email Server (General)
- EmailArchitect Email Server Development
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.