做了一个发邮件的小模块,如何让邮件接收后的发件人那一列不显示发件人的地址而显示名称?(10分)

  • 主题发起人 主题发起人 tianxing78
  • 开始时间 开始时间
T

tianxing78

Unregistered / Unconfirmed
GUEST, unregistred user!
做了一个发邮件的小模块,如何让邮件接收后的发件人那一列不显示发件人的地址而显示名称?<br>&nbsp; &nbsp; &nbsp; IdSMTP.Host:=m_smtphost;<br>&nbsp; &nbsp; &nbsp; IdSMTP.Username:=m_username;<br>&nbsp; &nbsp; &nbsp; IdSMTP.Password:=m_password;<br>&nbsp; &nbsp; &nbsp; IdSMTP.AuthenticationType:=atLogin; &nbsp;//我的服务器要求身份验证<br>&nbsp; &nbsp; &nbsp; IdSMTP.Port:=m_smtpport;<br>&nbsp; &nbsp; &nbsp; if trim(edit2.Text)&lt;&gt;'' then<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; TIdAttachment.Create(IdMessage.MessageParts,trim(edit2.Text));<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; IdMessage.CharSet:='gb2312';<br>&nbsp; &nbsp; &nbsp; Idmessage.ContentType:='text/plain' ;<br>// &nbsp; &nbsp; &nbsp;IdMessage.ReceiptRecipient.Text:=m_userid;//是否对已经阅读的邮件作出回复,回执<br>&nbsp; &nbsp; &nbsp; IdMessage.From.Address:=m_email;<br>&nbsp; &nbsp; &nbsp; IdMessage.ReplyTo.EMailAddresses:=m_email;<br>&nbsp; &nbsp; &nbsp; IdMessage.Recipients.EMailAddresses:=trim(usermail.fieldbyname('email').AsString);<br>&nbsp; &nbsp; &nbsp; IdMessage.Body.Assign(meSend.Lines);<br>&nbsp; &nbsp; &nbsp; IdMessage.Subject:=edtSubject.Text;<br>&nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; IdSMTP.Connect(); &nbsp;//连接SMTP服务器<br>&nbsp; &nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; &nbsp; exit;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; IdSMTP.Authenticate;<br>&nbsp; &nbsp; &nbsp; &nbsp; IdSMTP.Send(IdMessage); &nbsp;//向服务器发送邮箱<br>&nbsp; &nbsp; &nbsp; finally<br>&nbsp; &nbsp; &nbsp; &nbsp; IdSMTP.Disconnect;<br>&nbsp; &nbsp; end;
 
问题已经解决,谢谢
 
后退
顶部