나는 이것에 익숙하지 않지만 과거에는 비슷하게 만들었습니다. 기본적으로 사용자가 데이터를 입력 할 수있는 간단한 양식의 html 또는 .asp 페이지가 필요합니다. 나는 VB.net에서 다음과 같이 이것을 수행했다 :Outlook을 통해 이메일을 보내는 방법 .asp
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 페이지를 사용하여이 작업을 수행하는 더 쉬운 방법이 있습니까? 난 그냥 외부 메일 서버를 사용하지 않도록하고 양식을 실제 사용자로부터 보내려고 노력하고있어.
의견이 있습니까?
Outlook interop을 호출하는 방법을 잘 모르겠습니다. ASP.NET 프로젝트에서 'Microsoft.Office.Interop.Outlook'에 대한 참조를 추가 한 다음 .aspx로 래핑하면 코드가 마음에 들지 않습니다. – gfuller40
당신은'Dim oApp As New Microsoft.Office.Interop.Outlook.Application'을 작성할 수 있습니다. – nunzabar