Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 8 Jahren
Letzter Beitrag:
vor 8 Jahren
Beteiligte Autoren:
Al, Jimbo, Michael Drechsel, Marc De Swert

[WD14] Unattended email session with attachments

Startbeitrag von Al am 01.02.2010 03:38

Hello All

Is there any way to start an non Outlook email session to send an email with an attachment without knowing anything about the user or the smtp server ?

In one of our apps we have a login process that runs daily and emails reports to users. This works fine when the user has MS Outlook, but I cannot figure out how to run it with Thunderbird. The issue is that I may not know the user name and password or any other details about the mail service on the users computer. With an OutlookStartSession this doesn't matter because Windev must read it from the profile.

PCSoft must be able to do it internally because the report preview can use Thunderbird to send an email with an attachment.

I can't use mailto because it doesn't support attachments and interestingly, the mailto: function doesn't need any user or mail server info either.


Regards
Al

Antworten:

Hi Al,

have a closer look to "EmailSendMessage" wich handles emails with native SMTP.



von Michael Drechsel - am 01.02.2010 08:36
Hello Michael

Thanks for the idea. I had a look at it but it still needs the EmailStartSession() to run first and that function needs the username & password etc which is what I am trying to avoid.

Somehow PCSoft manage to do it all in the report preview regardless of the email client so I am curious why the same process is not made available to the email functions

I assume that the Outlook function passes information through to Outlook in some behind the scenes office automation process because emails I send using EmailStartOutlookSession end up in the sent items of Outlook but Items I send using EmailStartSMTPSession do not end up in Thunderbird when it is set up as my default email client.

Regards
Al


von Al - am 01.02.2010 09:30
We have an old programm that sends direct without seeing

like this:

doscommando IS STRING

doscommando = "Blat \\_apps\Userdocs\Push\BodyForPush.txt -to " +...
NameTO +...
" -server "+ MailServerName +...
" -f " + NameFrom +...
" -subject "+ SubjectTxt+...
" -bcc you@you.be "+...
" -attach \\_apps\Userdocs\Push\ " + AnyDocName

DDELance(doscommando)

Mayby this helps you out

Marc :cool:

von Marc De Swert - am 01.02.2010 09:37

Hi Al, if the customer has ANY email connection then they should have the username / password there. If they forgot it, http://www.nirsoft.net/utils/mailpv.html will be your friend. Otherwise, just in case the user has connection to the web but no e-mauil account then there'd be no problem to let your WinDev program send any mails through your own mail account at your provider. For that account you definitely do know the user & pw combination. Additionally, if you want them to send mails through their own account, why not use one of the free e-mail services like http://www.mail.com ?
Kind regards, Guenter

von Jimbo - am 01.02.2010 11:02
Hello Marc & Guenter

Thanks for the suggestions and code. It was a comment of Guenters about using my own details that gave me the answer. In a few of our sites a variety of people may use the same workstation and I was hung up the perceived problem of getting their email user name and password if they generated the login reports. I had missed the fact that it doesn't have to be the current users username and password, any old combination will do the job if it is valid, so all I need is one set, which I can get, to do the job.


Regards
Al



von Al - am 01.02.2010 21:06
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.