我对此并不熟悉,但我过去做过类似的事情。基本上,我想要一个带有简单表单的 html 或 .asp 页面,供用户输入数据。我已经在 VB.net 中通过以下方式完成了这项工作:
Imports Outlook = Microsoft.Office.Interop.Outlook
Private Sub cmdFax_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles cmdFax.Click
Dim oApp As Outlook._Application
oApp = New Outlook.Application()
Dim oMsg As Outlook._MailItem
oMsg = oApp.CreateItem(Outlook.OlItemType.olMailItem)
oMsg.Subject = ""
oMsg.Body = "" & vbCr & vbCr
If Len(txtEmail.Text) > 0 Then
oMsg.To = Me.txtEmail.Text
Else
oMsg.To = "[Fax:" & Me.txtAttn.Text & " @ " & Me.txtFaxNum.Text & "]"
End If
Dim sSource As String = "C:\ValidPath.txt"
Dim sDisplayName As String = "Hello.txt"
Dim sBodyLen As String = oMsg.Body.Length
Dim oAttachs As Outlook.Attachments = oMsg.Attachments
Dim oAttach As Outlook.Attachment
If Len(Me.TextBox1.Text) > 0 Then
oAttach = oAttachs.Add(Me.TextBox1.Text)
Else
End If
oAttachs.Add(Me.cboForm.SelectedValue)
oMsg.Send()
oApp = Nothing
oMsg = Nothing
oAttach = Nothing
oAttachs = Nothing
'MsgBox("Your Fax Has Been Sent Successfully")
lblStatus.Text = "Fax Sent"
'lblStatus.Text = "Ready"
End If
End Sub
反正有没有使用.asp 来完成同样的事情?或者有没有更简单的方法可以使用联系表格和 .asp 页面来做到这一点?我只是想避免使用外部邮件服务器并让实际用户发送表单。
接受任何建议!