发送邮件的开始时要用MAIL FROM和RCPT TO指定发送和接收地址,接着在后面的DATA命令里,又重新指定了发送地址和接收地址,如下所示:
MAIL FROM: <[email protected]>
RCPT TO: <[email protected]>
Data
Date: Thu, 11 Nov 2004 11:54:51 +0800
From: <[email protected]>
To: <[email protected]>
Subject: hello,world,everybody
所以不明白,网上有资料说前两个地址是信封地址,意思是不是说前两个地址是无关紧要的,填错了也没关系,真正的投递地址是由Data命令里面包含的信体内的From:<[email protected]>和To:<[email protected]>,是不是这样啊?
MAIL FROM: <[email protected]>
RCPT TO: <[email protected]>
Data
Date: Thu, 11 Nov 2004 11:54:51 +0800
From: <[email protected]>
To: <[email protected]>
Subject: hello,world,everybody
如果是象上面这样,那么真正接收邮件的是[email protected]还是[email protected]?在接收方,真正显示发送地址的是[email protected]还是[email protected]啊?

解决方案 »

  1.   

    mail.From= Request("sender") ' like [email protected]
    mail.To = Request("receiver") ' like [email protected]
    mail.Subject = Request("subject")
    mail.Body = Request("body")
    mail.BodyFormat = 0 ' 0 = HTML, 1 = Plain
    mail.MailFormat = 1 ' 0 = MIME, 1 = Text
    mail.Importance = 1 ' 0 =High, 1 = Medium, 2 = Low
    mail.attachFile ("c:\images\mypicture.gif") ' you can also attach files
    mail.Send
    set mail=nothing
      

  2.   

    没有绝对的关系,你可以查看程序员杂志2004/10,上面有我以前的一个文章,
    详细解释了这个问题,当然也可以直接查看RFC821/822协议文档