Hi,
I have built a small application to send emails in C#, I am now trying to get it to work in Access.
If the email address are hard coded into the C# app and a button pressed in Access the emails will send.
I have changed the C# app to accept arguments ie a To and CC email addresses.
I am having trouble referencing fields on a form where the email addresses are stored I have made an attempt at it but have been unable to complete it.
If the program where executed from DOS the command would be;
SendEmail.exe karl12@mailsever.com paul32@mailserver.com
This is what I am trying to replicate in the VBA of access when a button is clicked.
Thanks for any help on this...
Karl
I have built a small application to send emails in C#, I am now trying to get it to work in Access.
If the email address are hard coded into the C# app and a button pressed in Access the emails will send.
I have changed the C# app to accept arguments ie a To and CC email addresses.
I am having trouble referencing fields on a form where the email addresses are stored I have made an attempt at it but have been unable to complete it.
If the program where executed from DOS the command would be;
SendEmail.exe karl12@mailsever.com paul32@mailserver.com
This is what I am trying to replicate in the VBA of access when a button is clicked.
Code:
Private Sub SendMail_Click()
On Error GoTo Err_SendMail_Click
Dim stAppName As String
Dim stEmailTo As String
Dim stEmailCC As String
Forms![AddressBook]![Email] = stEmailTo.Value
Forms![AddressBook]![CC] = stEmailCC.Value
stAppName = "C:\Users\karl\Documents\Visual Studio 2008\Projects\SendEmail v1\SendEmail\bin\Debug\SendEmail.exe"
Call Shell(stAppName + stEmailTo + stEmailCC, 1)
Exit_SendMail_Click:
Exit Sub
Err_SendMail_Click:
MsgBox Err.Description
Resume Exit_SendMail_Click
End Sub
Thanks for any help on this...
Karl