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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SMTP Server in VFP

Status
Not open for further replies.

pmbroh

Technical User
Nov 13, 2004
13
US
Until now I have used VFP (8.0) to do emailing using the MAPI32 control to create SMTP commands and uses the existing email package (Outlook) to generate the emails. Corporate IT has implemented a Client-Managed Architecture and won't let me use this method anymore.

Does VFP provide its own SMTP Engine and if so where do I find info on using/configuring this.

Thanks, Pete B.
 
Thanks so much, Mike, Perfect - any advantage in selecting a specific Server. Sending simple mail with 3 text attachments.

Pete
 
any advantage in selecting a specific Server
"Normally" when you use SMTP protocol it is because you have an SMTP server to point to. Otherwise there is always CDO.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I think that CDO still requires an SMTP server, too.

You can use the foxwiki example to send emails *as* an SMTP server... it's just missing one part: The code to convert the email address domain into the MX server IP address. There isn't an easy way to do it (that is, there isn't a Windows API call to do it), but once it is done, the MX server is simply an SMTP server which only accepts emails "TO:" addresses in its domain(s).

If someone wants to help with this piece, noone would have to specify an SMTP server for SendMail to work....

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Bill

I think that CDO still requires an SMTP server, too.

I have to disagree on that. I use CDO2.0 without any reference to an SMTP server and I have no problem. I also using it on a stand alone XP computer.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Bill

Disregard my last comment.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike,

I have to admit, I don't actually use CDO, though I had explored it and found that it was an optional component (and so not guaranteed to be on my customers' computers), and that it was just an SMTP client, not able to optain the MX records and send directly to the final destination.

Are you saying that you've determined this to be the case, that the computer you're using CDO on does have an external SMTP server/relay configured?

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Are you saying that you've determined this to be the case, that the computer you're using CDO on does have an external SMTP server/relay configured?

My understanding is that if I use CDO without specifying an external SMTP server, it will use the local SMTP that is configured on my XP box (Add/Remove programs->Windows Components->IIS->SMTP service). At least that is what I make of this portion of MSDN documentation.
CDOSYS requires Windows 2000 and a local or remote SMTP server for submitting messages that can be an Internet Mail Connector (IMC).

If that is not the case, then I'm not sure how it is working. I just know it works.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Ok. This still requires the SMTP server be running on the Windows computer... which any SMTP client could use to send email, and (being optional) will often be missing on a customer's computer.

Can you still send emails with CDO if you don't configure an SMTP server, and Disable the SMTP Service?

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Can you still send emails with CDO if you don't configure an SMTP server, and Disable the SMTP Service?

If I use this:
Code:
o = CREATEOBJECT('cdo.message')
o.To = 'me@suntelecom.net'
o.From = 'me@suntelecom.net'
o.TextBody = "hello"
o.Send()

on my machine (with the SMTP installed) it works. Otherwise you would have to specify an an external SMTP server. Something like:
Code:
 iMsg = Createobject("CDO.Message")
iConf = Createobject("CDO.Configuration")
Flds = iConf.Fields
With Flds
            .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2
            .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = 'Your SMTP server name'
            .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 25
.Item ("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")[/URL] = cdoBasic
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusername")[/URL] = "youruserid"
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendpassword")[/URL] = "yourpassword"
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpusessl")[/URL] = .F.
.Item ("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")[/URL] = 60
.Update
Endwith

In either case, some kind of SMTP has to be running, otherwise you get a "The SendUsing configuration value is invalid".
My error was that I did not configure my own computer, and did not enable the SMTP service and never noticed it was enable, thus my statement above.





Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top