CDONTS TO 和 From 邮件存储在 DB 中

发布于 2024-12-02 13:16:11 字数 705 浏览 0 评论 0原文

我有一个旧的应用程序,它使用经典 ASP 中的 CDONTS 发送邮件。

现在,我想将发送的每封邮件的tofrom地址存储在数据库中。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愛上了 2024-12-09 13:16:11

这一行就是问题所在:

Dim a="' & 'FirstName LastName''"

更改为

Dim a: = """FirstName LastName""; “

或者

Dim a
a = """FirstName LastName"" <emailaddress>"

我已删除您发布的姓名和电子邮件地址,请根据需要进行替换。

This line is the problem:

Dim a="' & 'FirstName LastName'<emailaddress>'"

Change to

Dim a: = """FirstName LastName"" <emailaddress>"

or

Dim a
a = """FirstName LastName"" <emailaddress>"

I have removed the name and e-mail address you posted, replace as needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文