Having a BT landline and fibre broadband, I host my small website on a Raspberry Pi computer from home. The site has a contact form which tries to send an email to a btinternet address. However, this fails with a '553 error address not recognised' message which online searching suggests the BT mail server rejects the email as it comes from a dynamic IP address. Whilst I understand the need to fight spam, is there a way to be able send an email to a btinternet address from one of BT's own dynamic IP addresses? On a technical note, the website runs on Raspberry Pi's Raspbian operating system and the contact form is written in the PHP programming language, this calling the 'sendmail' program to send the email.
Solved! Go to Solution.
Why not just use an @btinternet.com email address and send using the BT SMTP server rather than your own.
The 'sendmail' program sends email as from email@example.com I presume if I sent the email from an email client, such as Thunderbird, then the BT mail server wouldn't complain but I cannot do that. The PHP calls the sendmail program to send the email. What I really need is advice on how to set up 'sendmail' so that the BT mail server is happy to take the email. Ultimately, the email would end up in my Gamil account - I only set up the @btinternet address in the hope it would take an email from one of BT's own dynamic addresses.
You would be better asking on a Pi forum really. You will always have difficulty sending directly from a dynamic address. You need to be able get the sendmail program to access either the Gmail or BT SMTP server rather than send directly.
Thanks for link to the Python script. I am not proficient in any way in Python so will need to take time to become familiar with the code. That said, I do not know how to call this script from my PHP code nor how it really differs in overcoming the problem of being sent from a dynamic address. As I said before, the preferred destination for the email is my existing Gmail a/c. I only registered for the btinternet address as I thought the BT mail server (SMTP) could be talked into accepting an email from one of BT's own dynamic IP addresses.
The problem is you are sending from your own address, if you used either the BT or Gmail SMTP server to send there wouldn't be a problem. You are not actually using the BT SMTP server currently.
Thanks for your reply. However, I don't understand the distinction between "I am sending from my own address" and "using a BT or Gmail SMTP server". How do I go about doing the latter?
If you send from either the BT or Gmail SMTP server your mail will be sent from the IP address of the server, not your IP address.
Yes, I get that. Now I need to work out how to get 'sendmail' to send from the BT/Gmail server. Thanks again for your help - appreciated.