I have the following script that sends an email message from a grid and cannot get it working properly.
If I use the same email parameters in an email profile on the desktop side, it works fine.
When I attempt to run this, it immediately pops up with the email successfully sent dialog box but the email is not being sent.
Any idea what I am overlooking?
Thanks
If I use the same email parameters in an email profile on the desktop side, it works fine.
When I attempt to run this, it immediately pops up with the email successfully sent dialog box but the email is not being sent.
Any idea what I am overlooking?
Thanks
Code:
FUNCTION email_sum2TS as c (e as p) ' 'example code: 'Return a Javascript command 'email_sum2TS = "alert('You submitted a value of: ');" 'debug(1) DIM pm as P DIM ps as P 'DIM ps.timeout as n 'ps.timeout = 60000 IF (email_smtp_open(ps, "smtp.xxxxxxxx.com", 25, "username", "password")) THEN pm.to = "[email protected]" pm.bcc = "[email protected]" pm.from = iif(eval_valid("session.__protected__userid"),session.__protected__userid,"[email protected]") pm.subject = "Subject Text" msgtxt = "Company: "+e._currentRowDataNew.Company + crlf() msgtxt = msgtxt + "Contact Person: "+e._currentRowDataNew.Contact + crlf() msgtxt = msgtxt + "Quote No.: "+e._currentRowDataNew.Quote + crlf(2) msgtxt = msgtxt + "Part 1: "+e._currentRowDataNew.Part1 + crlf() msgtxt = msgtxt + "Part2: "+e._currentRowDataNew.Part2 + crlf() msgtxt = msgtxt + "Address: "+e._currentRowDataNew.ADDRESS + crlf() msgtxt = msgtxt + "City: "+e._currentRowDataNew.CITY + crlf(2) msgtxt = msgtxt + "Salesman: "+e._currentRowDataNew.Salesman + crlf(2) msgtxt = msgtxt + "Notes: " + crlf() +e._currentRowDataNew.NOTE + crlf() pm.message = "Quote Notes:"+crlf(2)+msgtxt 'pm.html_message = "<HTML><B>This is the message in HTML</B></HTML>" email_smtp_send(pm, ps) email_smtp_close(ps) email_sum2TS = "alert('Email Request has been sent!');{grid.Object}._resetDetailViewWithoutConfirmation();closeParentA5Window('foo');" ELSE msgtxt = "Please check your connection." email_sum2TS = "alert('Email Request Failed:" + js_escape(crlf(2)+msgtxt) +"');" END IF END FUNCTION
Comment