I have to write a VBScript which will run on a Windows Server 03 (no Office, SMTP, etc. installed - like it's a fresh installation). This script should send E-Mails over an MS Exchange Server (on another server). So now I have a meeting with the head of the team managing those Servers. To prepare I'd like to know what ways I have to send an E-Mail from a VBScript over an MS Exchange (also including how to authenticate with the Exchange Server)?
As far as my googling goes there is one way with CDO (only SMTP?) which can use the current user for authentication or a clear text username & password.
edit:
Or am I mistaking and there is only SMTP for sending E-Mails over Exchange Server? Also that there is only authentication with clear text / using current credentials?
Cheers,
Gregor
There are other ways as well.
I'd prefer Exchange WebDav for previous versions of Exchange server
and use Exchange WebServices with the latest version of Exchange.
These method requires no client install so can be used anywhere.
WebDav: http://www.msexchange.org/articles/Access-Exchange-2000-2003-Mailbox-WebDAV.html
WebService: http://msdn.microsoft.com/en-us/library/aa563009(v=EXCHG.140).aspx
EWS scripting sample: Link
If you use CDO with SMTP and use Windows Authentication (NTLM).
Set objMessage = CreateObject("CDO.Message")
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 2
Setting that value to 0 makes it not use authentication, setting it to 1 uses basic authentication, and 2 makes it use NTLM.
Related
Usually, for Gmail and outlook we have app passwords to connect to SMTP (though we can use email passwords by enabling less secure app access).
But for my Microsoft Exchange mail I can't find the app password, nor I can connect my app with the mail to send emails.
import smtplib
password = "mypassword"
email = "usrname#tsac-uae.com"
s = smtplib.SMTP('smtp.office365.com', 587)
s.starttls()
s.login(email, password)
I get an error saying
smtplib.SMTPAuthenticationError: (535, b'5.7.139 Authentication unsuccessful,
SmtpClientAuthentication is disabled for the Tenant.
Visit https://aka.ms/smtp_auth_disabled for more information.
[AM9P192CA0015.EURP192.PROD.OUTLOOK.COM]')
To avoid these complications, I need to use an app password. But I can't find how to set up app password in exchange. Also, the steps said in the website is outdated. I can't find enable SMTP anywhere.
You need to enable SMTP submission (an organization-wide setting)
within your Microsoft Tenant as per the link you get in the error message, which expands to https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission.
The change can only be performed via powershell. An easy way to perform this change is by logging in at https://shell.azure.com. To use Exchange Online cmdlets in the Azure Cloud Shell, the Exchange Online cmdlets need to be imported using Connect-EXOPSSession.
Once connected, to enable SMTP submission use
Set-TransportConfig -SmtpClientAuthenticationDisabled $false
Make sure you read the article linked above to understand the security implications.
Also beware that
If your authentication policy disables basic authentication for SMTP,
clients cannot use the SMTP AUTH protocol even if you enable the
settings outlined in this article. For more information, see Disable
Basic authentication in Exchange Online.
I would like to send out notification from my php website. However I am using exchange. When I set up in sendmail.ini and php.ini. I dono what to key in for the smtp for my email exchange.
I would like to send out notification from my php website. However I am using exchange. When I set up in sendmail.ini and php.ini. I dono what to key in for the smtp for my email exchange.
I would like to send out notification from my php website. However I am using exchange. When I set up in sendmail.ini and php.ini. I dono what to key in for the smtp for my email exchange.
Anyone could help?
Exchange server is an SMTP server like all other internet e-mail servers.
Use the host name of your Exchange server, and port 25 or 465 (for SMTP/SSL).
Perhaps your Exchange server requires authentication. That is normal if you want to send to outside domains. In that case, you need to configure that as well.
You should ask your Exchange admins for the details, if you don't have them.
I can see many ehlo command echo from mail server like this:
I want to know what's different between "250-AUTH LOGIN PLAIN" and "250-AUTH=LOGIN PLAIN"? Thanks
They mean the same thing, but one is for backwards compatibility.
The first one, 250-AUTH LOGIN PLAIN, is the modern RFC-compliant way for a mail server to announce what authentication methods it supports. Authenticated SMTP is used to allow valid remote users to send mail through an SMTP server while still preventing spammers from connecting and using it as a relay.
The second example, 250-AUTH=LOGIN PLAIN, is an identical command but is intended for non-RFC-compliant email clients. Older clients, such as Outlook 2003 and older, did not implement the AUTH command correctly and instead expected an equals sign between AUTH and the available authentication methods.
For backwards compatibility, it is possible to enable both the compliant and non-compliant AUTH commands. In Postfix, for example, you can enable the broken_sasl_auth_clients option to force Postfix to broadcast AUTH twice. Otherwise, only the RFC-compliant AUTH command should be used.
they mean the same thing, the first one is the proper one but some mail clients only recognize the second line
I need to setup a POP3/SMTP server on our Ubuntu server (example.com). Now I found postfix useful for this job. Is it possible to let users from the group users (on the system) use this service, so they can login with their username/password? For example, if kevin is a user from the group users, then he can login on the POP3 server and retrieve (and send) mail for kevin#example.com? Is it also possible to save the in- and outgoing e-mails in a database?
Regards,
Kevin
Here ís a link to the Postfix features. I have only found that they store users in the database.
I am using a mailserver configured after the tutorials of workarounds.org and have also implemented servers following this solution for a few clients with up to 100 concurrent users for now.
But for example the DBMail project offers at least storing mails to databases.
I'm trying to make an SVN post-commit script that makes backups to a Gmail drive. Blat doesn't seem to support TLS. Are there any good scripting programs on windows that can send an email via TLS?
I don't know about other mail senders, but stunnel is able to accept a plain text connection and tunnel it through an SSL connection. You can have it listen on localhost:25 and make an SSL connection to an smtps server (tcp/465). I have used it in a similar situation where a WebDAV client didn't support SSL.
The blat folks are saying the stunnel is the best bet for tls support but i've found that gmail doesn't require tls to send mail. Now, the data may not be encrypted but I send out email via my account (to other gmail accounts only) all the time as an automated process and it works great. if you need it let me know and i'll drop in the command-line parms.