I had to rename my droplet to send mails, and it was renamed to my domain name, because I needed to be fqdn. When sending mails using php mail() function, it worked just fine, and the mails were received from something@mydomain.com, but then I turned off my droplet, resized it, turned it on again, and now my mails that are sent using php mail are being received from something@myolddropletname that is not even a domain, so I don’t know how to fix it.
My mails look something like this:
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Just had to update my /etc/mailname file
Hello, @Dantael
Would you mind checking that the hostname of the server is not changed back to what it was before your original change? I’m asking because you’ve mentioned that you’ve renamed the droplet in the past and now after the reboot this is no longer working for you.
In order to change the droplet’s name you can follow these steps:
Make sure you also edit your droplet’s hostname internally as well. Update
/etc/hostname
and/etc/hosts
and then reboot the droplet.Hope that this helps!
Regards, Alex