|
Home > Archive > Programming with dBASE > October 2005 > email center
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Heinz Kesting 2005-05-22, 7:23 am |
| Hi everybody,
I'm just making my first experiences with the db eMail center (db_mail.wfm
by J.P.Martel).
My problem at the moment is: where do I find the ISP server name needed for
sending an eMail?
I receive an error (OLE distribution error: connection timed out) when I try
to send a mail, probably because I put a wrong string there:
class email of oleautoclient("persits.mailsender") custom // do not
change
// this.host:="relais.videotron.ca" // put your ISP's server
name
this.host:="web.de" // that's probably wrong, I guess
this.from := "test@web.de" // put your e-mail address
this.FromName := "Heinz Kesting" // put your real name
this.subject := "No suject" // default subject
this.body := "No body" // default body text
endclass
From where can I get the correct name needed here?
Thanks in advance
Heinz
| |
| Robert Bravery 2005-05-22, 11:23 am |
| HI,
The property this.host, is where you put your mail server.
So if you hsot your own mail server, then thats were it goes, if not. Then
its the mails server of your isp. You could use the rl name or the ip
address. so this.host - "mail.urisp.co.za", or this.host = "192.196.168.25"
Also remember if you are using a isp host, that if they do not allow
relaying, then all your credentials are correct for that mail server,
I usually change these properties
this.helo = "mymailprefix" //tho it might not matter
and this.mailfrom ... is probably used to identify you on their mail server
so probably your valid email
this.password ... you mail password
this.username .. you mail server username
Then you should be ok
Robert
"Heinz Kesting" <hekesting AT web DOT de> wrote in message
news:5wJyNSrXFHA.1760@news-server...
> Hi everybody,
> I'm just making my first experiences with the db eMail center (db_mail.wfm
> by J.P.Martel).
> My problem at the moment is: where do I find the ISP server name needed
for
> sending an eMail?
> I receive an error (OLE distribution error: connection timed out) when I
try
> to send a mail, probably because I put a wrong string there:
>
> class email of oleautoclient("persits.mailsender") custom // do not
> change
> // this.host:="relais.videotron.ca" // put your ISP's server
> name
> this.host:="web.de" // that's probably wrong, I guess
> this.from := "test@web.de" // put your e-mail address
> this.FromName := "Heinz Kesting" // put your real name
> this.subject := "No suject" // default subject
> this.body := "No body" // default body text
> endclass
>
> From where can I get the correct name needed here?
>
> Thanks in advance
> Heinz
>
>
| |
| Heinz Kesting 2005-05-22, 1:23 pm |
| Hi Robert,
> The property this.host, is where you put your mail server.
> So if you hsot your own mail server, then thats were it goes, if not. Then
> its the mails server of your isp. You could use the rl name or the ip
> address. so this.host - "mail.urisp.co.za", or this.host =
"192.196.168.25"
> Also remember if you are using a isp host, that if they do not allow
> relaying, then all your credentials are correct for that mail server,
> I usually change these properties
> this.helo = "mymailprefix" //tho it might not matter
> and this.mailfrom ... is probably used to identify you on their mail
server
> so probably your valid email
> this.password ... you mail password
> this.username .. you mail server username
>
> Then you should be ok
>
Yes, after looking through some web pages in my mail account I found what I
needed, in my case it was "smtp.web.de".
Thank you for providing the tips with the username and password properties,
without these I had to log in via web before I could access my mail account
(however, somehow logical ...:)
But playing around with all that stuff I soon found out that this is NOT
want I actually need.
I need to give the users of my app the oppurtunity to send a mail back to
me, providing some information the programm collects in a dbf table. I want
to do this straight from the app, and for this I can't use the
eMail_center.wfm, I'm afraid.
I came across an API function discussed by Jan Hoelterling some time ago and
got it working for me. It calls the default mail services of the machine,
and I can provide my mail address and the text for the subject and body.
#define SW_SHOWNORMAL 1
#define WINAPI_SHELL "SHELL32"
#define WINAPI_A "A"
if type( "ShellExecute" ) # "FP"
extern cHandle ShellExecute( cHandle, cString, cString, cString, cString,
cINT );
WINAPI_SHELL from "ShellExecute" + WINAPI_A
endif
mailstr = "mailto:test@web.de ?Subject=Teststring Subject&Body=Teststring
body;
& Attachment='D:\DBASE
\Projekte\SDI_APP\Co
mp.log'" // this does
not have any effect
shellExecute(0, "open", mailstr, null, null, SW_SHOWNORMAL)
But I still miss the opportunity to attach the data table automatically -
can any one give me a clue how to do this? The above code is ignoring the
keywords attachment, attach, attached, and produces neither an error or any
other effect.
Thanks for helping, Heinz
| |
| Robert Bravery 2005-05-22, 1:23 pm |
| Hi,
Why don't you construct your own mail message. The mail center uses persist
mail, which must be installed on your machine. Why not use use persistmail,
send yourself the message and data atatchements you need.
I do this with persist mail, I also use ASP mail and some others as well,
depensing on different clients and whats available.
Robert
"Heinz Kesting" <hekesting AT web DOT de> wrote in message
news:fYuHO7uXFHA.1760@news-server...
> Hi Robert,
Then[color=darkred]
> "192.196.168.25"
> server
> Yes, after looking through some web pages in my mail account I found what
I
> needed, in my case it was "smtp.web.de".
> Thank you for providing the tips with the username and password
properties,
> without these I had to log in via web before I could access my mail
account
> (however, somehow logical ...:)
>
> But playing around with all that stuff I soon found out that this is NOT
> want I actually need.
>
> I need to give the users of my app the oppurtunity to send a mail back to
> me, providing some information the programm collects in a dbf table. I
want
> to do this straight from the app, and for this I can't use the
> eMail_center.wfm, I'm afraid.
> I came across an API function discussed by Jan Hoelterling some time ago
and
> got it working for me. It calls the default mail services of the machine,
> and I can provide my mail address and the text for the subject and body.
>
> #define SW_SHOWNORMAL 1
> #define WINAPI_SHELL "SHELL32"
> #define WINAPI_A "A"
> if type( "ShellExecute" ) # "FP"
> extern cHandle ShellExecute( cHandle, cString, cString, cString,
cString,
> cINT );
> WINAPI_SHELL from "ShellExecute" + WINAPI_A
> endif
> mailstr = "mailto:test@web.de ?Subject=Teststring Subject&Body=Teststring
> body;
> & Attachment='D:\DBASE
\Projekte\SDI_APP\Co
mp.log'" // this
does
> not have any effect
> shellExecute(0, "open", mailstr, null, null, SW_SHOWNORMAL)
>
> But I still miss the opportunity to attach the data table automatically -
> can any one give me a clue how to do this? The above code is ignoring the
> keywords attachment, attach, attached, and produces neither an error or
any
> other effect.
>
> Thanks for helping, Heinz
>
>
| |
| Heinz Kesting 2005-05-22, 8:23 pm |
| Hi Robert,
> Why don't you construct your own mail message. The mail center uses
persist
> mail, which must be installed on your machine. Why not use use
persistmail,
> send yourself the message and data atatchements you need.
> I do this with persist mail, I also use ASP mail and some others as well,
> depensing on different clients and whats available.
As far as I have understood persist mail, I must first run regsvr32 on the
clients machine to register the 2 dll files needed, which will bring up the
message boxes after the successful registration. That would not be too bad,
however there might be some users who would feel uncomfortable with messages
coming up without apparant reason that they don't understand.
But to send a mail finally, the user must know and enter some data about his
online connection into my form. It should be no problem with his mail
address, password and real name, but think about the ISP name, something I
myself stumbled over at first sight (and started this thread therefore).
How do you handle that? Most of the people I have to deal with are not
supposed to know details about their ISP names ...
That's why I thought it would be easier for them to have their default mail
program opened and all the data I need (including the attached file) already
well prepared for them. I hope it is possible to attach a file
programatically ...
Thanks, Heinz
| |
| Robert Bravery 2005-05-23, 3:23 am |
| HI Heinz,
You could register the dll through your program, using the silent parameter,
the user would not see any dialog boxes.
As far as ISP setting, if the user currently has e-mail, some one must have
set those up, if not themselves.
However, their might be a way of getting that info from the registry. You
would find this under the regkey
HKEY_CURRENT_USER\So
ftware\Microsoft\Int
ernet Account Manager\Accounts. But
depending on how many accounts the user has, there might be numerous values.
So under accounts you would have other keys representing the accounts, the
keys names would be somehing like 000000001 through to 00000016 and then
0000000a through to 0000000f, and so on, going up in hex numbers, depending
on howmany accounts they have. You would then need to scan trhough those
accounts and loook for the value of smtpserver, which will give you the
value of their smtp server
Cheers
Robert
"Heinz Kesting" <hekesting AT web DOT de> wrote in message
news:3G7lfVxXFHA.444@news-server...
> Hi Robert,
>
> persist
> persistmail,
well,[color=darkred]
>
> As far as I have understood persist mail, I must first run regsvr32 on the
> clients machine to register the 2 dll files needed, which will bring up
the
> message boxes after the successful registration. That would not be too
bad,
> however there might be some users who would feel uncomfortable with
messages
> coming up without apparant reason that they don't understand.
> But to send a mail finally, the user must know and enter some data about
his
> online connection into my form. It should be no problem with his mail
> address, password and real name, but think about the ISP name, something I
> myself stumbled over at first sight (and started this thread therefore).
> How do you handle that? Most of the people I have to deal with are not
> supposed to know details about their ISP names ...
> That's why I thought it would be easier for them to have their default
mail
> program opened and all the data I need (including the attached file)
already
> well prepared for them. I hope it is possible to attach a file
> programatically ...
>
> Thanks, Heinz
>
>
| |
| Heinz Kesting 2005-05-23, 8:23 pm |
| Hi Robert
> You could register the dll through your program, using the silent
parameter,
> the user would not see any dialog boxes.
Great - didn't thought of that possibilty!
> As far as ISP setting, if the user currently has e-mail, some one must
have
> set those up, if not themselves.
In anyway I'd aim to get the smtp server name by coding and try to avoid
asking the user for that.
> However, their might be a way of getting that info from the registry. You
> would find this under the regkey
> HKEY_CURRENT_USER\So
ftware\Microsoft\Int
ernet Account Manager\Accounts.
But
> depending on how many accounts the user has, there might be numerous
values.
> So under accounts you would have other keys representing the accounts, the
> keys names would be somehing like 000000001 through to 00000016 and then
> 0000000a through to 0000000f, and so on, going up in hex numbers,
depending
> on howmany accounts they have. You would then need to scan trhough those
> accounts and loook for the value of smtpserver, which will give you the
> value of their smtp server
If I don't find a way to get a file attached to a mail using an already
installed program I'd go with your solution.
Thanks a lot for your help!
Kind regards, Heinz
| |
| Linda C. Baker 2005-10-11, 7:27 am |
| Did you ever find a good way to do this? I want to do the exact same thing that you are doing (Have the user email a file from their system automatically). I also found how to use the html mailto command to open the user's email client, but it will not
do attachments. The other solutions seem to complex for something simple. Anyway, I wondered if you ever got it working and what solution you used? Thanks.
Heinz Kesting <hekesting AT web DOT de> Wrote:
> Hi Robert
>
> parameter,
>
> Great - didn't thought of that possibilty!
>
> have
>
> In anyway I'd aim to get the smtp server name by coding and try to avoid
> asking the user for that.
>
> But
> values.
> depending
>
> If I don't find a way to get a file attached to a mail using an already
> installed program I'd go with your solution.
>
> Thanks a lot for your help!
> Kind regards, Heinz
>
>
| |
| Rick Gearardo 2005-10-11, 7:27 am |
| There's a bunch of ways but I use aspEmail which is a free smtp client and
very easy to use. I use it to email service calls to techs automatically
when a service call is opened, to customers when a call is closed, to
project managers when a change had been made to an existing job by sales and
to vendors with the PO attached on new parts orders.
Rick
> Did you ever find a good way to do this? I want to do the exact same
> thing that you are doing (Have the user email a file from their system
> automatically). I also found how to use the html mailto command to open
> the user's email client, but it will not do attachments. The other
> solutions seem to complex for something simple. Anyway, I wondered if you
> ever got it working and what solution you used? Thanks.
| |
| Linda C. Baker 2005-10-11, 7:27 am |
| I downloaded that and looked at it yesterday. I got stuck when it said you have to enter the users smtp server and the sender's email address. How do you get that data from the system without the user having to enter it?
Thanks.
Rick Gearardo Wrote:
> There's a bunch of ways but I use aspEmail which is a free smtp client and
> very easy to use. I use it to email service calls to techs automatically
> when a service call is opened, to customers when a call is closed, to
> project managers when a change had been made to an existing job by sales and
> to vendors with the PO attached on new parts orders.
>
> Rick
>
>
>
| |
| Rick Gearardo 2005-10-11, 7:27 am |
| I have a login routine in all my programs that looks up the user's email
address from a user database and stores it as an _app variable. You should
know the smtp address of the location you're sending from. I save the info
to a dbf file. If this is for general use you have the customer enter their
smtp address on install and make it editable in case of ISP changes.
Rick
>I downloaded that and looked at it yesterday. I got stuck when it said you
>have to enter the users smtp server and the sender's email address. How do
>you get that data from the system without the user >having to enter it?
| |
| Linda C. Baker 2005-10-11, 7:27 am |
| So you basically have the user enter their email address and information and then save it. I was hoping there was a way to get it without them having to enter it.
Am I correct in thinking that if I used an oleautoclient for Outlook.application, then it would use their outlook to send the email and the user would not have to enter their setup information? Is the problem with doing it that way, is that it will only
work with Outlook and maybe only certain versions of Outlook? I may check into that and if it will work for most people (I think most of the users have Outlook), that may be another option.
Thanks again for your help.
Linda
Rick Gearardo Wrote:
> I have a login routine in all my programs that looks up the user's email
> address from a user database and stores it as an _app variable. You should
> know the smtp address of the location you're sending from. I save the info
> to a dbf file. If this is for general use you have the customer enter their
> smtp address on install and make it editable in case of ISP changes.
>
> Rick
>
>
>
>
| |
| Rick Gearardo 2005-10-11, 7:27 am |
| Yes, in initial setup only. My apps are all multi-user so the user
themselves do not enter the info but the system administrator does. Since
the info is saved in a file it is looked up when they log in.
What exactly are you trying to do?
Rick
"Linda C. Baker" <lbaker@sboa.in.gov> wrote in message
news:gwiKT00yFHA.1304@news-server...
> So you basically have the user enter their email address and information
> and then save it. I was hoping there was a way to get it without them
> having to enter it.
>
> Am I correct in thinking that if I used an oleautoclient for
> Outlook.application, then it would use their outlook to send the email and
> the user would not have to enter their setup information? Is the problem
> with doing it that way, is that it will only work with Outlook and maybe
> only certain versions of Outlook? I may check into that and if it will
> work for most people (I think most of the users have Outlook), that may be
> another option.
>
> Thanks again for your help.
>
> Linda
>
> Rick Gearardo Wrote:
>
>
| |
| Linda C. Baker 2005-10-11, 7:27 am |
| I work for a state agency and I have a dbase program that various local governements use to enter their financial year end data. I want them to be able to push a button and it will automatically email their data files to me. Maybe even automatically upd
ate my central database here. They will all have different computer systems, software, and level of computer skills.
I am not an expert so any advice is appreciated.
Thanks.
Rick Gearardo Wrote:
> Yes, in initial setup only. My apps are all multi-user so the user
> themselves do not enter the info but the system administrator does. Since
> the info is saved in a file it is looked up when they log in.
>
> What exactly are you trying to do?
>
> Rick
>
> "Linda C. Baker" <lbaker@sboa.in.gov> wrote in message
> news:gwiKT00yFHA.1304@news-server...
>
>
| |
| Rick Gearardo 2005-10-11, 7:27 am |
| I would assume you would have a login so anyone that walks by cannot access
the program? If so set up a user database. You can use the id() fumction to
capture the network login name for the login screen and set up a user.dbf to
hold user info:
(watch for wrap)
user.dbf
User Password Email
and a system.dbf to hold things like smtp address and email destination
sersys.dbf
SMTP financialDeptEmail
login would be along the lines of:
pbLogin_onclick
if form.users1.rowset.findKey(trim(form.entryFieldUser.value)) .and.
trim(form.entryFieldPassword.value) ==
trim(form.users1.rowset.fields["password"].value)
_app.userEmailAddress = trim(form.users1.rowset.fields["email"].value)
// and any other user info you want to capture
else
msgbox("incorrect")
endif
They would fill in the form and push a button:
pbSend_onClick
LOCAL ok, em
try
em = new email()
ok = true
catch (exception e)
Run(.t.,"regsvr32 "+set("dire")+"\AspEmail.dll /s")
try
em = new email()
ok = true
catch(exception e)
msgbox("Didn't work")
ok = false
endtry
endtry
if ok
em. AddAddress(trim(form
.sersys1.rowset.fields["financialDeptEmail"].value))
em.host = trim(form.sersys1.rowset.fields["SMTP"].value)
em.from = _app.userEmailAddress
em.subj = "Financial Data"
em.body = "whatever message you want to send"
form.e.AddAttachment("yourFile")
em.send()
endif
form.message_sent = ok
form.Close()
"Linda C. Baker" <lbaker@sboa.in.gov> wrote in message
news:ku08to2yFHA.1412@news-server...
>I work for a state agency and I have a dbase program that various local
>governements use to enter their financial year end data. I want them to be
>able to push a button and it will automatically email their data files to
>me. Maybe even automatically update my central database here. They will
>all have different computer systems, software, and level of computer
>skills.
>
> I am not an expert so any advice is appreciated.
>
> Thanks.
>
> Rick Gearardo Wrote:
>
>
| |
| Linda C. Baker 2005-10-11, 7:27 am |
| Thanks, I will try that.
Rick Gearardo Wrote:
> I would assume you would have a login so anyone that walks by cannot access
> the program? If so set up a user database. You can use the id() fumction to
> capture the network login name for the login screen and set up a user.dbf to
> hold user info:
>
> (watch for wrap)
>
> user.dbf
> User Password Email
>
> and a system.dbf to hold things like smtp address and email destination
>
> sersys.dbf
> SMTP financialDeptEmail
>
> login would be along the lines of:
>
> pbLogin_onclick
> if form.users1.rowset.findKey(trim(form.entryFieldUser.value)) .and.
> trim(form.entryFieldPassword.value) ==
> trim(form.users1.rowset.fields["password"].value)
> _app.userEmailAddress = trim(form.users1.rowset.fields["email"].value)
> // and any other user info you want to capture
> else
> msgbox("incorrect")
> endif
>
> They would fill in the form and push a button:
>
> pbSend_onClick
> LOCAL ok, em
> try
> em = new email()
> ok = true
> catch (exception e)
> Run(.t.,"regsvr32 "+set("dire")+"\AspEmail.dll /s")
> try
> em = new email()
> ok = true
> catch(exception e)
> msgbox("Didn't work")
> ok = false
> endtry
> endtry
> if ok
> em. AddAddress(trim(form
.sersys1.rowset.fields["financialDeptEmail"].value))
> em.host = trim(form.sersys1.rowset.fields["SMTP"].value)
> em.from = _app.userEmailAddress
> em.subj = "Financial Data"
> em.body = "whatever message you want to send"
> form.e.AddAttachment("yourFile")
> em.send()
> endif
> form.message_sent = ok
> form.Close()
>
| |
| Rick Gearardo 2005-10-11, 7:27 am |
| You will need to add this in somewhere:
class email of oleautoclient("persits.mailsender") custom
endclass
"Linda C. Baker" <lbaker@sboa.in.gov> wrote in message
news:Weo60h3yFHA.1236@news-server...
> Thanks, I will try that.
>
> Rick Gearardo Wrote:
>
>
|
|
|
|
|