CDONTS TO 和 From 邮件存储在 DB 中
我有一个旧的应用程序,它使用经典 ASP 中的 CDONTS 发送邮件。
现在,我想将发送的每封邮件的to
和from
地址存储在数据库中。
Dim a="' & 'FirstName LastName'<emailaddress>'"
trixMail.From= a
Dim b = "anotheremailaddress"
trixMail.To = b
a =TrixMail.From
b= TrixMail.To
Dim MM_query
Dim MM_editCmd
MM_query = "Insert into Logmail(FromEmail,ToEmail) values('"+a+"', '"+b+"')"
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_dbConn_STRING
MM_editCmd.CommandText = MM_query
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
所以,这就是我正在做的事情。但是,我收到一条错误消息
预期语句结束于声明变量“a”的行。
那么,你能让我知道我哪里出错了吗?
I have an old application which sends mail using CDONTS in classic ASP.
Now, I wanted to store the to
and from
addresses of every mail sent in a database.
Dim a="' & 'FirstName LastName'<emailaddress>'"
trixMail.From= a
Dim b = "anotheremailaddress"
trixMail.To = b
a =TrixMail.From
b= TrixMail.To
Dim MM_query
Dim MM_editCmd
MM_query = "Insert into Logmail(FromEmail,ToEmail) values('"+a+"', '"+b+"')"
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_dbConn_STRING
MM_editCmd.CommandText = MM_query
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
So, this is what I'm doing. However , i get an error saying
Expected end of statement at the line i declare variable 'a'.
So, can u let me know where I'm going wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这一行就是问题所在:
Dim a="' & 'FirstName LastName''"
更改为
Dim a: = """FirstName LastName""; “
或者
我已删除您发布的姓名和电子邮件地址,请根据需要进行替换。
This line is the problem:
Dim a="' & 'FirstName LastName'<emailaddress>'"
Change to
Dim a: = """FirstName LastName"" <emailaddress>"
or
I have removed the name and e-mail address you posted, replace as needed.