Indy Mail server

匿名 (未验证) 提交于 2019-12-03 01:23:02

问题:

Following is my code for the smtp client for sending email

    VAR SMTP : TIdSMTP;  MSG : TIdmessage;  begin     MSG:=TIdmessage.Create(NIL);   TRY     WITH MSG.Recipients.Add DO BEGIN       Name:='me025';       Address:='me025@gmail.com'     END;     MSG.BccList.Add.Address:='me025@yahoo.com';     MSG.From.Name:='self025';     MSG.From.Address:='self025@127.0.1.1';     MSG.Body.Text:='<Message Body>';     MSG.Subject:='<Subject of message>';     SMTP:=TIdSMTP.Create(NIL);     TRY       SMTP.Host:='127.0.1.1'; // IP Address of SMTP server       // 127.0.1.1       SMTP.Port:=25; // Port address of SMTP service (usually 25)       SMTP.Connect;       TRY         SMTP.Send(MSG)       FINALLY         SMTP.Disconnect       END     FINALLY       SMTP.Free     END   FINALLY     MSG.Free   END;   end; 

which will use a SMTPserver in same pc

the smtp server is a working indy 10 unofficial sample http://indy.fulgan.com/ZIP/Indy10demo.zip

whenever i connect to the server "Socket error # 11001 Host not found " error occers

but smtp server is receiving all the parameters correctly and showing correctly on the GUI

回答1:

Has your PC an address of 127.0.1.1 or are you trying to use localhost (127.0.0.1)? People should get used to DNS names... as soon as IPv6 will become mainstream at least people won't be able any longer to remember IP numbers easily :)



文章来源: Indy Mail server
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!