SMTP is one-way, from sender to receiver. You cannot send emails with TIdSMTPServer
, only receive them. Your SMTP server needs to store received emails as needed for you to retrieve them later, via POP3/IMAP, or whatever custom system you want to make.
When someone wants to send an email to you at info@xyz.in
, they perform a DNS lookup of the MX record for xyz.in
, then connect to that server and issue SMTP commands to deliver the email to the info
mailbox 1. So you need to configure your domain's DNS MX record to point at the IP address of your SMTP server machine.
To send an email from your system to someone else, use TIdSMTP
instead, so it can connect to and send the email to the other person's SMTP server. You can use TIdDNSResolver
to lookup a domain's MX records to find the IP address(es) to connect to 1.
1: most users send an outgoing email through their ISP's own SMTP server and let it relay the email to each recipient's domain SMTP server as needed. And use their ISP's SMTP server to receive emails. This is easier for users to use and configure, and it is safer as it allows ISPs to implement security and anti-spam measures. So you may end up sticking with GoDaddy's SMTP server instead of running your own in the long run.