This topic is locked

Question marks (?) on Send email with new data

10/10/2017 10:05:29 AM
ASPRunner.NET General questions
Y
yairilan author

Hi,

We use Hebrew unicode (UTF-8) settings and use "Send email with new data" after record updated.

We'are getting question marks instead of Hebrew characters.

What can we do about it?

Here is a print screen: print screen
Thanks

admin 10/10/2017

Make sure you select correct encoding when sending an email:

https://www.xlinesoft.com/asprunnernet/docs/runner_mail_function.htm

Y
yairilan author 10/10/2017

Hi thanks.

Do you mean charset?

I use VB do you have an example for VB?

Pete K 10/10/2017

Try passing the charset attribute as "UTF-8" to the mail function.
https://www.w3schools.com/html/html_charset.asp

Y
yairilan author 10/10/2017

Thanks! But I need help how to to it in the Runner email function with VB.

Can you please give an example?

The example here:https://www.xlinesof...il_function.htm is on C#

admin 10/11/2017

Show us your existing code and we'll help you with this.

Y
yairilan author 10/11/2017

Hi, it's exactly as the action example, I didn't change anything yet:



Public Function AfterAdd(values As Object, keys As Object, inline As Object, pageObject As Object) As XVar
'********** Send email with new data ************
Dim email = "test@test.com"

Dim from = "admin@test.com"

Dim msg = New StringBuilder("")

Dim subject = "New data record"
For Each field In values.GetEnumerator()

If Not CType(CommonFunctions.IsBinaryType(pageObject.pSet.getFieldType(field.Key)), Boolean) Then

msg.Append(field.Key.ToString() & " : " & field.Value.ToString() & Environment.NewLine)

End If

Next



Dim ret = MVCFunctions.runner_mail(New XVar("to", email, "subject", subject, "body", msg.ToString(), "from", from))

If Not CType(ret("mailed"), Boolean) Then

MVCFunctions.EchoToOutput(ret("message"))

End If
admin 10/12/2017
'********** Send email with new data ************
Dim email = "test@test.com"

Dim from = "admin@test.com"

Dim msg = New StringBuilder("")

Dim subject = "New data record"
For Each field In values.GetEnumerator()

If Not CType(CommonFunctions.IsBinaryType(pageObject.pSet.getFieldType(field.Key)), Boolean) Then

msg.Append(field.Key.ToString() & " : " & field.Value.ToString() & Environment.NewLine)

End If

Next



Dim ret = MVCFunctions.runner_mail(New XVar("to", email, "subject", subject, "body", msg.ToString(), "from", from, "charset", "utf-8"))

If Not CType(ret("mailed"), Boolean) Then

MVCFunctions.EchoToOutput(ret("message"))

End If
Y
yairilan author 10/19/2017

Hi! thanks! But it didn't help...

This is the print screen of the email:

And this is the code:


If values("Lead_Status").ToString()="הועבר לטיפולוג" then
'********** Send email with new data ************
Dim email = "support@emailaddress.co.il"

Dim from = "info@emailaddress.co.il"

Dim msg = New StringBuilder("")

Dim Link = "http://cccmrmm.cliniclics.com/dbo_Crm_Leads/view?editid1="; & values("Id_lead").ToString() & " "

Dim subject = "ליד חדש לטיפולוג"
For Each field In values.GetEnumerator()

If Not CType(CommonFunctions.IsBinaryType(pageObject.pSet.getFieldType(field.Key)), Boolean) Then

msg.Append(field.Key.ToString() & " : " & field.Value.ToString() & Environment.NewLine)

End If

Next
Dim ret = MVCFunctions.runner_mail(New XVar("to", email, "subject", subject, "body", msg.ToString()& " CcrmLink: " & link.ToString(), "from", from, "charset", "utf-8"))

If Not CType(ret("mailed"), Boolean) Then

MVCFunctions.EchoToOutput(ret("message"))

End If
else
End if
admin 10/23/2017

You need to post your project to Demo Account and contact support directly.

Pete K 10/26/2017

I still think the issue is with the charset. I was guessing that utf-8 would do the trick, but I know nothing about encoding for non-Latin languages. I suggest you do some research on encoding for Hebrew characters and try different encodings when passing that parameter to the function, i.e., change "utf-8" to something else.



Dim ret = MVCFunctions.runner_mail(New XVar("to", email, "subject", subject, "body", msg.ToString()& " CcrmLink: " & link.ToString(), "from", from, "charset", "utf-8"))
Y
yairilan author 10/26/2017



You need to post your project to Demo Account and contact support directly.


Sorry I can't. I have a private database.

Y
yairilan author 10/26/2017



I still think the issue is with the charset. I was guessing that utf-8 would do the trick, but I know nothing about encoding for non-Latin languages. I suggest you do some research on encoding for Hebrew characters and try different encodings when passing that parameter to the function, i.e., change "utf-8" to something else.



Dim ret = MVCFunctions.runner_mail(New XVar("to", email, "subject", subject, "body", msg.ToString()& " CcrmLink: " & link.ToString(), "from", from, "charset", "utf-8"))



Thanks a lot! I'll try

admin 10/27/2017

What prevents you from building a test project with non-sensitive test data and uploading it to Demo Account?

Y
yairilan author 10/28/2017



What prevents you from building a test project with non-sensitive test data and uploading it to Demo Account?


Cause I'm not so good with SQL and duplicate DB. In this project I'm connected to exist data and I don't know how to rebuild it...
I'll try a few encodings and let you know

Thanks!