-1

I have acquired the domain name - xyz.in from GoDaddy.com and also acquired the mail ID - info@xyz.in. And currently, I can able to send 500 mails by using GoDaddy.

So, I'm thinking to implement my Mail Server using Delphi - TIdSmtpServer. I found few samples but for sending mails how can I use the sender ID as info@xyz.in and send mails. As I need to send only mails, what are the other settings and please provide some basic sample code.

Thanks in advance.

1 Answers1

3

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.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770