Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SendMail account info from text file?
#1
Hi,

Is there a way to have an .exe macro that I create import the sender SMTP server and email account settings for SendMail, say from a text file/ini/xml?

In otherwords, I want to provide a .exe program to a client that, as part of its function, sends out an automatic email. This works if I create the sender account in QM and create the .exe. But this is not a long-term solution. I am worried about the hard-coding aspect of this, since the user won't be able to change the email account and server info in the future.

If this is not possible, is there another way to do this? (example would be greatly appreciated)


Best,

Steve
#2
When you create code with 'Send email message' dialog, and check Var, it creates code like this:
Macro Macro1528
Code:
Copy      Help
_s=
;smtp_server ...
;...
SendMail "a@b.c" "s" "b" 0 "" "" "" "" "" _s

Uncomment the account settings and place in a text file. Let the macro load the file.
Macro Macro1528
Code:
Copy      Help
_s.getfile("$qm$\email account settings.txt")
SendMail "a@b.c" "s" "b" 0 "" "" "" "" "" _s
#3
Great, thank you Sir!

S
#4
Question...

I did the above and works fine, but I am puzzeled as to how this works without a password ? Is the password only necessary for checking mail? Security issue with my provider?

smtp_server smtp.servercompany.net
smtp_port 25
smtp_user
smtp_password
smtp_auth 0
smtp_secure 0
smtp_timeout 60
smtp_email audio@servercompany.net
smtp_displayname "Me Myself"
smtp_replyto "Me Myself"

(obviously I've changed names, but this is the sum that created by toolbar and pasted into the txt file)
#5
Some SMTP servers don't require password.


Forum Jump:


Users browsing this thread: 1 Guest(s)