please paste the code you are using to send the email
Cannot send email from website using mail server
Hello, I am in much need of help on a problem that I have not been able to work past in nearly a week.
I have currently setup two servers. One a mail server and the other to host my site.
The issue I am facing is that my contact form on my website cannot send emails. Trying to do so you get the error from laravel:
Expected response code 354 but got code "554", with message "554 5.5.1 Error: no valid recipients "
The error indicates that the address I am emailing is not valid, but it is and I have had this working using the live mail server, on my local machine. I have even changed the recipient to a working gmail account to be sure. I am 99% sure that the laravel site is set up correctly.
What is interesting is that I get a different errors from postfix on the mail server side. Here are the four logs that are generated from request to send mail.
Oct 23 22:52:07 compute-it postfix/submission/smtpd[1417]: connect from li1525-157.members.linode.com[139.162.240.157]
Oct 23 22:52:07 compute-it postfix/submission/smtpd[1417]: Anonymous TLS connection established from li1525-157.members.linode.com[139.162.240.157]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
Oct 23 22:52:07 compute-it postfix/submission/smtpd[1417]: NOQUEUE: reject: RCPT from li1525-157.members.linode.com[139.162.240.157]: 554 5.7.1 <li1525-157.members.linode.com[139.162.240.157]>: Client host rejected: Access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<compute-it.org.uk>
Oct 23 22:52:07 compute-it postfix/submission/smtpd[1417]: disconnect from li1525-157.members.linode.com[139.162.240.157] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 quit=1 commands=5/7
Any ideas? I seriously have gone everywhere and tried everything I can think of. to be clear: port 587 is open on both The mail server works i.e. I can send and receive mails. The website sends mail to the mail server using the mail server when ran on my local machine. The to and from address are valid and working.
The problem is here. You are looking for env variables by value, not key
'username' => env('[email protected]'),
'password' => env('***********'),
Should be
'username' => env(MAIL_USERNAME),
'password' => env(MAIL_PASSWORD),
Please or to participate in this conversation.