Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SMTP Settings
I just found this wonderful email function, never knew it existed, thank youuuuuuuuu!

Now how do I run this dialog box from QM Sad See attached picture. And also set it as default automatically?

Attached Files Image(s)
Copy      Help

Although it is private function (called when you click Accounts in Send Email Message dialog), it will not be removed in the future, and it is safe to use it in macros.

Also read "Email help" macro.

Default email account is specified in registry key Software\Microsoft\Internet Account Manager, in HKEY_CURRENT_USER. Sorry, I don't remember what value must be changed. You'll see it in registry editor.
Found it!

One of the many features I never knew existed. So much faster and easier to send email now.

Thanks so much!
Can you use variables in SendMail function? Like the email address, subject and message?
Variables can be used in all functions, with few exceptions (declarations, case).
Got them figured out thank you Confusedhock:
Copy      Help
Dir d; str sPath
str Sbj="My Subject
str Msg="My Message
str x="c:\smithdr\200609*.txt"
str y z
foreach(d x FE_Dir 0x4)
    y.from(y sPath "[;]"); err
z.from("''" y "''")
z.findreplace(";" "")
out z

SendMail "" Sbj Msg 0 z "" "" "" "" "Denise"

As you can see, I used variables on subject, message and attachment. The code only works without the attachment.

The attachment string looks like this using out command:

Copy      Help

If I copy and paste from the debugger window it works Confusedhock:
Attachment files must be delimited by new lines, not []. When you use [] in a quoted string, it is replaced to new line. And whole string must not be enclosed in ". The example in the SendMail documentation shows how the string could look in the editor.

SendMail ... "file1[]file2"
Use escape sequence [91] instead of [. Or, even easier, 2 strings: "[" "]".

Problem Fixed :lol:
Few questions about SendMail function:

1. Are the sent email saved someplace? A log or a record?

2. Also, is there a way to check if it was sent?
If sending mail fails, SendMail generates error.

SendMail ...
,out "failed"

By default, sent messages are not saved. To save, use SendMail flag 0x800 (will save in "$my qm$\SmtpMail"), or instead of SendMail use functions of SmtpMail class.

SmtpMail mail
Copy      Help
Dir d; xAttach
foreach(d "$my qm$\*.dat" FE_Dir 0x4)
    xAttach.from("''" xPath "''")
    SendMail "" "Files" "Attached" 0 xAttach "" "" "" "" "QM"
    out xAttach

The above example generates an error:

"Error (RT) in SendArchive: SendMail: cannot add attachment "C:\Documents and Settings\Dad\My Documents\My QM\drsmith1024.dat"
Delete ,xAttach.from("''" xPath "''")

Use this to send multiple messages
Copy      Help
Dir d; str xPath
foreach(d "$my qm$\*.dat" FE_Dir 0x4)
,SendMail "" "Files" "Attached" 0 xPath "" "" "" "" "QM"

or this to send single message with all files
Copy      Help
Dir d; str xAttach
foreach(d "$my qm$\*.dat" FE_Dir 0x4)
,xAttach.from(xAttach xPath "[]")
out xAttach
SendMail "" "Files" "Attached" 0 xAttach "" "" "" "" "QM"
Cool thanks bro
Hi - regarding sendmail
SendMail "" "subject" "text"
My question is what is the correct syntax to embedd an integer type variable as part of the subject?
Hope you can help Big Grin
int test=7
str sub
sub.format("subject %i" test)
SendMail "" sub "text"
works a treat thanks hugely Confusedhock:
Having some problems with mail.

It says this in a message... "Some settings are missing for this email account:"

Any idea what that could mean? I have everything filled out...
ok i dont get that message anymore but now i get this...

Error (RT) in "Macro6 /0"oMacro6: SendMail: [Error: Connection failure] (0x4)
Server response:
Can you send email from that account in Outlook Express? If yes, you only need to enter password in the QM email account dialog.

Of course QM email functions are not as smart as email programs. With some email accounts don't work. Works with most.
nope i just tryed...doesnt work in outlook express idea why any idea?
im getting the same thing as QM_Expert

Error (RT) in "Function4 /305"oFunction4: SendMail: [Error: Connection failure] (0x4)
Server response:

can anyone help me out
Maybe you need newer QM version.
i have the newest one, im using that is it setup right?

;smtp_port 465
;smtp_user chevyman
;smtp_password default
;smtp_auth 2
;smtp_secure 1
;smtp_timeout 60
;smtp_displayname "chevy man"
int test=7
str sub
sub.format("subject %i" test)
SendMail "" sub "text"
No. Your macro uses default account settings, not what is in your macro. To insert correct code, open 'Send email message' dialog, select gmail accout (create if does not exist), check Var, click OK.
how do i create or open it?
The dialog is in the floating toolbar.
ok i still get this
Error (RT) in "Function5 /0"oFunction5: SendMail: [Error: Connection failure] (0x4)
Server response:

do i have to edit the QM EMail Settings, fill in all thei nfo there too? do you think you could show a screen shot with the info filled in, but not the real info?
If you don't have gmail account settings, easier is to change the code.

;smtp_port 465
;smtp_user chevyman
;smtp_password default
;smtp_auth 2
;smtp_secure 1
;smtp_timeout 60
;smtp_displayname "chevy man"
int test=7
str sub
sub.format("subject %i" test)
SendMail "" sub "text" 0 "" "" "" "" "" _s

To see what fails, add flag 0x80000.

SendMail "" sub "text" 0x80000 "" "" "" "" "" _s
run "$my qm$\smtp_log.txt"
ok i filled all the info in correctly i ran it and got

Error (RT) in "Function5 /305"oFunction5: SendMail: some email account settings missing

Forum Jump:

Users browsing this thread: 1 Guest(s)