Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook e-mail properties

Status
Not open for further replies.

GhostWolf

Programmer
Jun 27, 2003
290
US
Does anyone know of a way to programmatically set the .From and .ReplyTo properties in an e-mail?

The program I'm working on needs to send notification e-mails. The problem is that we don't want replies - at least, not to the account from which the messages will be sent.

Search as I might, I haven't found a way to set these properties yet and would sure appreciate any guidance.
 
What language are you working in? Is it Outlook VBA? Something else?
 
>VB6.

Ok - and how are you using VB6 to send email? CDO? CDONTS? MAPI? Outlook automation? SMTP via Inet? SMTP via winsocks? Mailto?

You need to help us a little here before we can help you.
 
Outlook automation.

From what I've found:
- CDO/CDONTS will let me set the properties I want, but requires relaying to be turned on at the server, which PETAYBE won't allow;
- MAPI, understandbly, behaves the same as the Outlook object plus it tosses a second dialog box for address resolution, (and fails with an unknown error if the resolution parm is set to false).

I haven't seen samples using SMTP. Can you point me in the right direction?

I must not have paid much attention to MailTo. The only place I've seen it used was in HTML.

Background:
Someone wrote us a web page that used MailTo to send requests to one of our offices. Unfortunately, MailTo only wants to work if you have an e-mail account set up on your machine and, all too often, this wasn't the case.

So someone else changed the web page to collect the requestor's information and load it into an Access database.

And I get the call to create an app to pull the data from Access, validate it via a remote mainframe, update our local i5, and send a status message to the requestor.

Pull, parse, validate, update/reject - hey, all that stuff's no problem. But this e-mail stuff's a whole new ball of wax to me.
 
Below is a short version of the SMTP via CDO example I provided in thread222-1143694.
Code:
[blue][green]' Requires a reference to Microsoft CDO for Exchange 2000
' or to Microsoft CDO for Windows 2000[/green]
Private Sub Command1_Click()
    With New CDO.Message
        With .Configuration.Fields
            .Item(cdoSendUsingMethod) = cdoSendUsingPort
            .Item(cdoSMTPServer) = "target.smtpserver.com"
            .Item(cdoSMTPConnectionTimeout) = 10
            .Item(cdoSMTPServerPort) = 25
            .Update
        End With
        .To = "destination@email.com"
        .Subject = "Example"
        .TextBody = "Hello"
        .From = "source@home.com"
        .Send
    End With
End Sub[/blue]
 
Just found a sample of SMTP and tried it, and found the same problem as CDO: relaying needs to be turned on, and I haven't been able to convince the powers that be to turn it on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top