I have a button that sends an email message via a UX using our web application (DBF).
I have been using the gmail smtp server for several years to send the email and it has worked perfectly. Suddenly, the emails no longer send from our web app. In researching, it appears Gmail is no longer allowing you to use their smtp server for this purpose.
I setup an account with Mailjet as an alternative and it does work with one minor issue.
I set a session variable with the users login name which is their email address. I submit this variable in the email so we have the senders email address for replies. When the email is sent via Mailjet, this variable value will not send. I have to assume they are blocking it perhaps?
My Xbasic code for doing the above is as follows:
Any suggestions appreciaed.
Thanks
I have been using the gmail smtp server for several years to send the email and it has worked perfectly. Suddenly, the emails no longer send from our web app. In researching, it appears Gmail is no longer allowing you to use their smtp server for this purpose.
I setup an account with Mailjet as an alternative and it does work with one minor issue.
I set a session variable with the users login name which is their email address. I submit this variable in the email so we have the senders email address for replies. When the email is sent via Mailjet, this variable value will not send. I have to assume they are blocking it perhaps?
My Xbasic code for doing the above is as follows:
Code:
FUNCTION email_sum2 as c (e as p) ' 'debug(1) DIM pm as P DIM ps as P DIM ps.timeout as n ps.timeout = 60000 ' 'The following uses Gmail and worked fine until 07/09/21. 'IF (email_smtp_open(ps, "smtp.gmail.com", 465, "[email protected]", "password123","SSL")) THEN ' 'The following uses Mailjet and works except the 'Sent From' field results in a blank value ' IF (email_smtp_open(ps, "in-v3.mailjet.com", 465, "username", "password","SSL")) THEN pm.to = "[email protected]" pm.bcc = "[email protected]" ' pm.from = iif(eval_valid("sesson.__protected__userid"),session.__protected__userid,"[email protected]") ' The above pm.from line does not work with MailJet as the mail must be sent from our domain or it will not send ' Changed to the followint so email will send properly pm.from = iif(eval_valid("sesson.__protected__userid"),"[email protected],"[email protected]") pm.subject = "Web Request" msgtxt = "Case No.: "+e._currentRowDataNew.CASE_NO + crlf() msgtxt = msgtxt + "File No.: "+e._currentRowDataNew.FILE_NO + crlf() msgtxt = msgtxt + "Document: "+e._currentRowDataNew.DOCUMENT + crlf(2) msgtxt = msgtxt + "Plaintiff: "+e._currentRowDataNew.PLAINTIFF + crlf() msgtxt = msgtxt + "Defendant: "+e._currentRowDataNew.DEFENDANT + crlf() msgtxt = msgtxt + "Address: "+e._currentRowDataNew.ADDRESS + crlf() msgtxt = msgtxt + "City: "+e._currentRowDataNew.CITY + crlf(2) msgtxt = msgtxt + "Server: "+e._currentRowDataNew.SERVER + crlf() msgtxt = msgtxt + "Sent From " + session.__protected__userid + crlf(2) 'This value worked with the gmail smtp server but results in a blank value with Mailjet's server msgtxt = msgtxt + "Notes: " + crlf() +e._currentRowDataNew.NOTE + crlf() pm.message = "Please provide case info on the following:"+crlf(2)+msgtxt email_smtp_send(pm, ps) email_smtp_close(ps) email_sum2 = "alert('Email Request has been successfully sent!');{dialog.object}.buttonClick('BUTTON_2');A5.msgBox.hide();" ELSE msgtxt = "Please check your connection." email_sum2 = "alert('Email Request Failed:" + js_escape(crlf(2)+msgtxt) +"');A5.msgBox.hide();" END IF END FUNCTION
Thanks
Comment