I'm trying to send emails via smtp.gmail.com in the standard way, and I'm getting a standard error, but for some non-standard reason.
Specifically, I get this error: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. when I send the mail.
The answers on this link have not helped me: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required?
I suspect that there are additional steps required if you're trying to do this from a custom domain.
I've created a throw-away standard Gmail account to test out my code and everything works perfectly there.
If I en-/dis-able Less Secure Apps then it behaves as you'd expect, and as per the linked solutions.
If I en-/dis-able 2FA and create 3rd party app passwords then, again, it behaves as I'd expect, and as per the linked solutions.
So my code, and my ability to configure a general Gamil acccount, are working just fine.
But when I use an otherwise identical GSuite email address, set up on a custom domain (system#clientdomain.co.uk) then nothing works :( I've tried all the permutations, with/without LessSecureApps, with main user password / with 3rd Party App Password, etc. Nothing works.
I can only assume that either the custom domain or the fact that it's a GSuite account is breaking it.
What now?
So apparently I either needed to wait longer, or change the settings harder!!
A colleague wandered past and asked what the problem was and I demonstrated it, including going through and setting the settings again, and this time it worked. I'm 80% sure they were the same settings, but perhaps not?
Related
I am using WPS, a diluted version of SAS, and I cannot send emails through the SMTP server using the normal (and fairly well documented) config flags.
I keep receiving the error message:
SSL exception: Could not initialise security context [80090322]
Having found some forum posts, the description for this issue is that the SMTP server is expecting authentication using a certificate. When I mentioned this to the IT team, nothing came from it. Having used SAS for a significant period, you would normally and quite simply apply some very basic information into the config file (see below).
I've been given the admin username and password, I've used an array of different ports, but still the same error message persists.
Does anyone have any ideas on how to make SAS/WPS connect to a secure SMTP? Config file is:
-emailsys SMTP
-emailhost 10.0.x.x
-emailport 23 (Port 23 was opened for my use, we are not able to use port 25).
The error message persists even if I force the credentials via -emailid and -emailpw.
Thanks in advance,
Dan
The fix for this is to utilise a fully qualified domain name, rather than an IP address or other method.
I know this is very old, but I had a really bad time trying to figure this same problem out and I'd like to post my solution here for people who might need it in the future.
Basically, this problem happens because SAS/WPS is trying to validate the certificate he has gotten from the smtp server when trying to interact with it (ie.: send an e-mail).
There are 2 solutions:
You can define the location were the trusted certificators are stored for the system to validate it.
You can define the server option TLS_HOSTVALIDATION to NONE by doing something like OPTIONS TLS_HOSTVALIDATION=NONE
I hope this helps.
I'm searching for an E-Mail provider (for free) where you can set up different passwords for POP and SMTP and Login access.
So far Google-Search hasn't found anything useful about this.
Please give me some suggestions.
Normally, licensing should be done using a Licence Manager that should be hosted on a Web Server that is reachable by your application (that is deployed on your client's machine or run on the Web).
An example of an implementation of a licensing system is shown here and you should take a look before starting coding.
However, if you insist on using e-mails for validation, you can embed a Web Browser control (or a div, iframe or something similar) and ask the user to create a free account on some e-mail provider. All major e-mail providers use CAPTCHAs, that's why human input is required.
It looks like it is possible to set password fields values, so your application can set the password and use the account from now on.
However, this solution seems really ugly to me and also might confuse the users, since they might enter their e-mail account credentials by mistake.
I have written a couple of web sites that contain a "contact us" form.
However, our host recently switched SMTP off. Their excuse is "security issues".
The solution they offer is that they implemented rules whereby all mail generated from the platforms must be sent using the sendmail/phpmail functions and pass through a mail relay which checks the mails and their content and ensures malicious content and activity is completely blocked and they recommend I use "A virtual or dedicated solution".
I have no idea what it is they want me to do to get emailing working again and this is quite urgent as many clients are not getting their emails.
Is there an easy way to go around this in order to get emailing working again?
Many thanks in advance
It generally means that you will have to specify the new mail server they are providing instead of localhost in your code. Further, earlier, you were able to send the mail without authenticating but now on, you must have an account and you must authenticate before you send the mail. (I am not sure though, may be they allow relay to their own servers and you might not need authentication).
Go to the control panel of your hosting account and check for the mail panel. Check out the new smtp server name there and code your site to use this smtp server with credentials. This will let you send mail again.
We've ported several legacy ColdFusion sites from rackspace to viviotech, and they all work fine except for sending email using the cfmail tag. When viewing the CF mail.log it contains this error message for each attempt:
"Error","scheduler-0","07/01/10","06:31:22",,"Invalid Addresses; nested exception is: class javax.mail.SendFailedException: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.5.3 - chkuser) "
However, looking at the rcpthosts file, the domain is indeed there that was used in the "from" attribute of cfmail. going into the CF admin, you can set the SMTP server and verify connection. I have tried both 127.0.0.1 as well as the actual IP of the server--both verify as successful connections, but I still can't send email. The old server worked fine for this (even though CF is not supported by rackspace, but IS supported by vivio).
One advice I was already given was use the user:password#server.com construct, but I don't want to do that since none of these domains are reliably permanent--we are wanting to change most or all of the sites to PHP in the next year if possible. I just want to be able to use the local SMTP without restriction, as I was able to on the previous server.
Actually I found the key to the answer here: http://www.palomine.net/qmail/relaying.html
The new server we moved to uses qmail instead of sendmail, which has major restrictions on email by default. There is a "selective relay" link on this page that has steps to remedy, although it's an annoyingly large number of steps.
Does anyone know of a free, anonymous smtp service? I want to give users of my app the ability to occasionally send me an anon email without having to configure a server of enter their email account. I guess I could setup a gmail account for this purpose and embed the credentials in the app but I hope it won't be necessary. In case it sways your answer, this is a thick client (.NET Console) app.
I think that what you're asking for is called an open relay.
If there were such a thing, wouldn't it immediately be swamped by spammers?
You might be better off setting up some kind of commenting tool on your website, that sends you an email with the contents of whatever form the user submits. Then if you go that far, it shouldn't be difficult to add a form to your app that automatically makes the full HTTP request (transparent to the user, in the background).
If you run your own mail server, you can simply configure the app to deliver mail directly to it. Many web hosting companies also provide mail hosting if you don't want to run it on your own hardware. Gmail via Google Apps for your domain might be an option. It's free. But their anti-spam measures might prevent delivery. Better to have a server you can control, I think. Bottom line, though, is you don't need an anonymous SMTP relay server to get the job done.