Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SMTP Settings
#1
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)
   
#2
Code:
Copy      Help
MailSetup

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.
#3
Found it!

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

Thanks so much!
#4
Can you use variables in SendMail function? Like the email address, subject and message?
#5
Variables can be used in all functions, with few exceptions (declarations, case).
#6
Got them figured out thank you Confusedhock:
#7
Code:
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)
    sPath=d.FileName(1)
    y.from(y sPath "[;]"); err
z.from("''" y "''")
z.findreplace(";" "")
out z

SendMail "myemail@home.com" 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:

Code:
Copy      Help
"c:\smithdr\20060901.txt[]c:\smithdr\20060903.txt[]c:\smithdr\20060904.txt[]"

If I copy and paste from the debugger window it works Confusedhock:
#8
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"
#9
Use escape sequence [91] instead of [. Or, even easier, 2 strings: "[" "]".


Problem Fixed :lol:
#10
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?
#11
If sending mail fails, SendMail generates error.

SendMail ...
err
,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
mail.AddMessage(...)
mail.SetSaveFolder(...)
mail.Save()
mail.Send()
#12
Code:
Copy      Help
Dir d; xAttach
foreach(d "$my qm$\*.dat" FE_Dir 0x4)
    xPath=d.FileName(1)
    xAttach.from("''" xPath "''")
    SendMail "myemail@home.com" "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"
#13
Delete ,xAttach.from("''" xPath "''")

Use this to send multiple messages
Code:
Copy      Help
Dir d; str xPath
foreach(d "$my qm$\*.dat" FE_Dir 0x4)
,xPath=d.FileName(1)
,SendMail "myemail@home.com" "Files" "Attached" 0 xPath "" "" "" "" "QM"

or this to send single message with all files
Code:
Copy      Help
Dir d; str xAttach
foreach(d "$my qm$\*.dat" FE_Dir 0x4)
,xPath=d.FileName(1)
,xAttach.from(xAttach xPath "[]")
out xAttach
SendMail "myemail@home.com" "Files" "Attached" 0 xAttach "" "" "" "" "QM"
#14
Cool thanks bro
#15
Hi - regarding sendmail
i.e.
SendMail "test@test.com" "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
#16
int test=7
str sub
sub.format("subject %i" test)
SendMail "test@test.com" sub "text"
#17
works a treat thanks hugely Confusedhock:
#18
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...
#19
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:
#20
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.
#21
nope i just tryed...doesnt work in outlook express either...no idea why any idea?
#22
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
#23
Maybe you need newer QM version.
#24
i have the newest one, im using that is it setup right?

;smtp_server smtp.gmail.com
;smtp_port 465
;smtp_user chevyman
;smtp_password default
;smtp_auth 2
;smtp_secure 1
;smtp_timeout 60
;smtp_email chevyman@gmail.com
;smtp_displayname "chevy man"
;smtp_replyto chevyman@gmail.com
int test=7
str sub
sub.format("subject %i" test)
SendMail "chevyman@gmail.com" sub "text"
#25
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.
#26
how do i create or open it?
#27
The dialog is in the floating toolbar.
#28
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?
#29
If you don't have gmail account settings, easier is to change the code.

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


To see what fails, add flag 0x80000.

...
SendMail "chevyman@gmail.com" sub "text" 0x80000 "" "" "" "" "" _s
run "$my qm$\smtp_log.txt"
#30
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)