I am a beginner and am working on the following function to send out emails
function emailSendSMTP as c (e as p)
dim t as p
dim pm as P
dim ps as P
dim cycle as n
cycle=0
t = table.open("email")
t.fetch_first()
while .not. t.fetch_eof()
cycle=cycle+1
if (email_smtp_open(ps, "smtp.gmail.com", 465, "[email protected]", "mypassword","SSL"))then
pm.to = t.Email
pm.from = "[email protected]"
pm.subject = e._currentRowDataNew.subject
pm.html_message = e._currentRowDataNew.messageBody
email_smtp_send(pm, ps)
end if
email_smtp_close(ps)
if cycle=10
cycle=0
sleep(10)
end if
t.fetch_next()
end while
t.close()
DIM SHARED SentEmailsMsgBox_result as N
DIM SHARED SentEmailsMsgBox_OK_Button as L
SentEmailsMsgBox_OK_Button = .F.
title_var = "My Company"
message_text_var = <<%text%
Emails Have Been Sent
%text%
SentEmailsMsgBox_result=ui_msg_box(title_var,message_text_var,UI_OK+ UI_FIRST_BUTTON_DEFAULT+ UI_INFORMATION_SYMBOL)
'Test to see which button on the message box was pressed....
SELECT
CASE SentEmailsMsgBox_result = UI_OK_SELECTED
SentEmailsMsgBox_OK_Button= .t.
END SELECT
end function
Main question:, Is there a way to "hide" my email password and/or is this something I shouldn't worry about?
I have tested this two different times and both times I get an email from gmail saying someone on the other side of the country has tried to log in to my account.
Or is this my Zebra Host server, where my app is published?
Second question: I need help with the wording of a filter in the xbasic function that will send emails to only records that the value in field_1 equals "Yes"
Third question: Is there a way to count records that equals "Yes" and include that in the "Emails Have Been Sent Message"?
Example: "64 Emails Have Been Sent"
I am using SQL Server as the back end and
Thanks
Tony
function emailSendSMTP as c (e as p)
dim t as p
dim pm as P
dim ps as P
dim cycle as n
cycle=0
t = table.open("email")
t.fetch_first()
while .not. t.fetch_eof()
cycle=cycle+1
if (email_smtp_open(ps, "smtp.gmail.com", 465, "[email protected]", "mypassword","SSL"))then
pm.to = t.Email
pm.from = "[email protected]"
pm.subject = e._currentRowDataNew.subject
pm.html_message = e._currentRowDataNew.messageBody
email_smtp_send(pm, ps)
end if
email_smtp_close(ps)
if cycle=10
cycle=0
sleep(10)
end if
t.fetch_next()
end while
t.close()
DIM SHARED SentEmailsMsgBox_result as N
DIM SHARED SentEmailsMsgBox_OK_Button as L
SentEmailsMsgBox_OK_Button = .F.
title_var = "My Company"
message_text_var = <<%text%
Emails Have Been Sent
%text%
SentEmailsMsgBox_result=ui_msg_box(title_var,message_text_var,UI_OK+ UI_FIRST_BUTTON_DEFAULT+ UI_INFORMATION_SYMBOL)
'Test to see which button on the message box was pressed....
SELECT
CASE SentEmailsMsgBox_result = UI_OK_SELECTED
SentEmailsMsgBox_OK_Button= .t.
END SELECT
end function
Main question:, Is there a way to "hide" my email password and/or is this something I shouldn't worry about?
I have tested this two different times and both times I get an email from gmail saying someone on the other side of the country has tried to log in to my account.
Or is this my Zebra Host server, where my app is published?
Second question: I need help with the wording of a filter in the xbasic function that will send emails to only records that the value in field_1 equals "Yes"
Third question: Is there a way to count records that equals "Yes" and include that in the "Emails Have Been Sent Message"?
Example: "64 Emails Have Been Sent"
I am using SQL Server as the back end and
Thanks
Tony
Comment