Comments (7)
I'll change behavior to use 25 instead of 587. And add tips on errors.
from mailozaurr.
What parameters exactly are you using to send with one and to send with other?
from mailozaurr.
With Mailozaurr: Send-EmailMessage -From 'emailaddress' -To 'emailaddress' -Subject 'subject' -SmtpServer 'server' -Attachments "attachmentfilepath"
With Mailkit:
$smtp = New-Object Mailkit.Net.Smtp.SmtpClient
$message = New-Object MimeKit.MimeMessage
$messageBodyBuilder = New-Object MimeKit.BodyBuilder
$message.From.Add("emailaddress")
$message.To.Add("emailaddress")
$message.Subject = 'subject'
$messageBodyBuilder.Attachments.Add("attachmentfilepath") | Out-Null
$message.Body = $messageBodyBuilder.ToMessageBody()
$smtp.Connect('server')
$smtp.Send($Message)
$smtp.Disconnect($true)
$smtp.Dispose()
from mailozaurr.
The difference is in a port most likely. The default that I've taken is 587. Otherwise, there's no port defined and I guess it uses 25, and that's what you're looking for assuming no login/pass.
from mailozaurr.
Actually it does default to 587. If I put -Port 587 at the end it still fails
from mailozaurr.
i mean put 25 at the end ... you're using no login/password - 587 by design requires login/password so you're most likely sending email using relay. Therefore you need port 25.
from mailozaurr.
Works now! Maybe put a note in the readme to specify the port since the original Send-MailMessage doesn't require it?
from mailozaurr.
Related Issues (20)
- How to specify 'Encoding' when sending mail using '-graph' HOT 3
- How to get <CR><LF> in body text using plain ASCII input from file HOT 18
- FIlename containing ie round brackets dont show correctly in attachment
- Small problem with Email-name
- Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe HOT 3
- how to correctly download attachment HOT 7
- Is there any way how to get path to email item ? HOT 1
- MX Record IPAddress with -Separate HOT 5
- Get 403 after using Send-EmailMessage HOT 6
- From field should be mandatory
- If Path doesn't exists, an error occurs (attachments) HOT 1
- How to delete mail from IMAP ?
- Adapting "from" with custom name HOT 1
- Can't send attachment > 3Mb using Graph HOT 2
- SkipCertificateValidation => wrong naming HOT 2
- Feature Request: SkipCertificateCheck on Connect-IMAP/Connect-POP3
- Logging HOT 5
- Cannot update Mailozaurr 1.0.2 - not trusted any longer HOT 2
- -AttachSelf option like in Emailimo HOT 1
- -SkipCertificateValidatation does not seem to work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mailozaurr.