www.webdeveloper.com
Results 1 to 5 of 5

Thread: cdo.message and from adress in hebrew

  1. #1
    Join Date
    Jan 2003
    Location
    Israel
    Posts
    1,381

    cdo.message and from adress in hebrew

    i am sending email on win2003 server using the cdo.message object.
    i have channged the HTMLbodypart and TextBodyPart charset's to "windows-1255", so the email arrives ok but only the FROM which is like this :
    """ קבוצה "" <email@eee.com> " i recive with ???????
    why is that?
    what can infloance the from address charset?
    thnaks in advance
    peleg

  2. #2
    Join Date
    Nov 2004
    Location
    Canada
    Posts
    379
    I don't think you can change it. Changing jay@someemail.com into hebrew would not be so helpful for the person trying to reply, which is why I think it does not get converted. If the receiver clicks "reply", he/she would not be able to reply unless they wrote the e-mail in english again. This is just my assumption.

  3. #3
    Join Date
    Jan 2003
    Location
    Israel
    Posts
    1,381

    that is not correct

    beacuse the hebrew is just a text u soo and when u click its like a link where the email is behind it
    morethen that i want to see the from in the rows of the mailbox which write there fro m who is the email!

  4. #4
    Join Date
    May 2008
    Posts
    1
    Hello.
    HELP NEEDED...

    I'm trying to send an html email via website, using ASP screept that sends the email which is prepered and ready to be sent in an html template and format. the text in the email is in english and hebrew. encoding is UTF-8.
    I have 2 problems - first one is that the email apears in unrecognized language- "jibrish" and second - the jpg image apears as an attachment instad of in the emails body.

    his is the ASP code:

    <!--
    METADATA
    TYPE="typelib"
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    NAME="CDO for Windows 2000 Library"
    -->
    <%
    Const ForReading = 1

    Dim sBody
    Dim htmlFile
    Set htmlFile = CreateObject("Scripting.FileSystemObject")

    Session.CodePage=65001 ' make this c.ap use utf by default

    sBody =
    htmlFile.OpenTextFile(Server.MapPath("HTMLSampleEmail.html"),ForReading,false,-1).ReadAll()

    On error resume next
    Set cdoConfig = CreateObject("CDO.Configuration")

    With cdoConfig.Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "mail.barak.net.il"
    .Item(cdoSMTPAuthenticate) = 1
    .Item(cdoSendUsername) = "simulator-barak.net.il"
    .Item(cdoSendPassword) = "qazwsx"'"zz27AY"
    .Update
    .Update
    End With

    Set cdoMessage = CreateObject("CDO.Message")

    With cdoMessage
    Set .Configuration = cdoConfig
    .From = "someone@someone.co.il"
    .To = Request("address")
    .Subject = "e-mail message from website"
    .BodyPart.Charset = "utf-8"
    .HTMLBody = sBody
    .AddRelatedBodyPart Server.MapPath("attach.jpg"),
    "attach.jpg", 0
    .Send
    End With

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
    if Err=0 then
    response.Redirect "index.html"
    else
    Response.Write "Error sending message: " & err.Description
    end if
    %>


    and this id the simple html code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title></title>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/
    intellisense/ie5">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    </head>
    <body>
    <table border="0" align="right">
    <tr>
    <td align="right" valign="top">
    <b><font face="Arial" color="navy" size="2">,לקוח יקר </font></b>
    <br>
    <br>
    <font color="navy" size="2" face="Arial">זהו מייל ניסיון הנשלח
    אליכם מהאתר </font>
    <br>
    <br>
    <b><font face="Arial" color="navy" size="2">,בהצלחה</font></b>
    <br>
    <b><font face="Arial" color="navy" size="2">צוות האתר </font></b>
    <br>
    <br>
    <font face="Arial" color="gray" size="1">שיווק ומכירות </font>
    <br>
    <a href="mailto:sales@admail.co.il" target="_blank"
    onClick="return top.js.OpenExtLink(window,event,this)">
    <font face="Arial" color="gray" size="1">sales@website.co.il </
    font></a>
    <br>
    <font face="Arial" color="gray" size="1">03-533333</font>
    <font face="Arial" color="gray" size="1" dir="rtl">טל.</font>
    <br>
    <font face="Arial" color="gray" size="1">תמיכה </font>
    <br>
    <a href="mailto:support@admail.co.il" target="_blank"
    onClick="return top.js.OpenExtLink(window,event,this)">
    <font face="Arial" color="gray" size="1">support@website.co.il </
    font></a>
    <br>
    <br>
    <br>
    <font face="Arial" color="navy" size="2"><b>Dear Customer,</b> </
    font>
    <br>
    <br>
    <font face="Arial" color="navy" size="2">Bla Bla Bla BlaBla
    BlaBla<br>
    BlaBla Bla Bla Bla Bla Bla Bla<br>
    Bla Bla Bla Bla
    BlaBla BlaBla
    <br>
    BlaBla BlaBla Bla </font>
    <br>
    <br>
    <font face="Arial" color="navy" size="2"><b>Good luck</b> </font>
    <br>
    <font face="Arial" color="navy" size="2"><b>Website team</b> </
    font>
    <br>
    <br>
    <font face="Arial" color="gray" size="1">Sales and Marketing </
    font>
    <br>
    <font face="Arial" color="gray" size="1">Tel. 972-3-5333333 </
    font>
    <br>
    <a href="mailto:sales@admail.co.il" target="_blank"
    onClick="return top.js.OpenExtLink(window,event,this)">
    <font face="Arial" color="gray" size="1">sales@website.co.il </
    font></a>
    <br>
    <font face="Arial" color="gray" size="1">Support </font>
    <br>
    <a href="mailto:support@admail.co.il" target="_blank"
    onClick="return top.js.OpenExtLink(window,event,this)">
    <font color="gray" face="Arial" size="1">support@website.co.il </
    font></a>
    </td>
    <td>&nbsp;</td>
    <td style="BORDER-RIGHT: silver 1px inset">&nbsp;</td>
    <td>&nbsp;</td>
    <td valign="top" align="center">
    <a href="http://www.google.com"><img src='cid:attach.jpg'
    border="0" align="middle"></a>
    <br>
    <a href="http://www.admail.co.il"><i><font face="Arial"
    color="Gray" size="1" style="TEXT-DECORATION: none">powered by admail</
    font></i></a>

    </td>
    </tr>
    </table>
    </body>
    </html>


    Please help.

    THANKS IN ADVANCE.

  5. #5
    Join Date
    Sep 2008
    Posts
    1

    sending hebrew HTL with CDOSYS

    not sure if you found the answer but this works for me:

    1. I have a session that telling me if email in English or Hebrew.
    2. Use a Sub to send email from all my pages.
    3. I use charset=windows-1255, but UTF-8 should be good as well.

    Here is the sub that have BOTH CDOSYS LOCAL SMTP (if info is missing for remote) and CDONTS REMOTE SMTP :


    sub sendEmail(strFrom,strTo,strBcc,strSubject,strBody,intImportance,strAttachment)


    If session("DefaultLang") = "HEB" then 'email is in Hebrew:
    '=======================================

    HTML = "<html>"
    HTML = HTML & "<head>"
    HTML = HTML & "<meta http-equiv=""Content-Type"""
    HTML = HTML & "content=""text/html; charset=windows-1255"">"
    HTML = HTML & "<meta name=""GENERATOR"""
    HTML = HTML & " content=""Microsoft Visual Studio 6.0"">"
    HTML = HTML & "<title>" & strSubject & "</title>"
    HTML = HTML & "</head><body dir='rtl'>"

    else 'email is in English
    '=======================================

    HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
    HTML = HTML & "<html>"
    HTML = HTML & "<head>"
    HTML = HTML & "<meta http-equiv=""Content-Type"""
    HTML = HTML & "content=""text/html; charset=iso-8859-1"">"
    HTML = HTML & "<meta name=""GENERATOR"""
    HTML = HTML & " content=""Microsoft Visual Studio 6.0"">"
    HTML = HTML & "<title>" & strSubject & "</title>"
    HTML = HTML & "</head><body>"

    end If 'session("DefaultLang")
    '=======================================
    CloseHTML = "</body></HTML>"

    strEmailBodyText = HTML & strBody & CloseHTML
    if intImportance="" then intImportance=1

    'gett username, sever name and password needed for CDOSYS remote server:
    strServerEmail = Trim(Application.Contents("Email" & Session.Contents("DefaultLang")))
    strServerPassword = Trim(Application.Contents("EmailPassword" & Session.Contents("DefaultLang")))
    strServerName = Trim(Application.Contents("EmailServer" & Session.Contents("DefaultLang")))

    Set ObjSendMail = CreateObject("CDO.Message")


    IF len(strServerEmail)=0 OR len(strServerPassword)=0 or len(strServerName)=0 Then
    ' Use CDOSYS via REMOTE SERVER
    '==========================================================================================
    'This section provides the configuration information for the remote SMTP server.
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 'Send the message using the network (SMTP over the network).
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = Application("MailServer")
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    ' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = Application("Email")
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = Application("EmailPassword")
    'End remote SMTP server configuration section==
    If session("DefaultLang") = "HEB" then
    ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/mailheader/content-type") = "text/html; charset=""windows-1255""" 'text/html
    ObjSendMail.Configuration.Fields.Item("urn:schemas:mailheader:content-type") = "text/html; charset=""windows-1255"""
    end if
    ObjSendMail.Configuration.Fields.Update
    END IF
    '==========================================================================================


    ObjSendMail.BodyPart.Charset = "windows-1255"
    ObjSendMail.From = strFrom
    ObjSendMail.To = strTo
    if strBcc <>"" then
    ObjSendMail.BCC = strBCC
    end if
    if strAttachment <> "" then
    ObjSendMail.AddAttachment (Server.MapPath("/Files/") & "\" & strAttachment)
    end if
    ObjSendMail.Subject = strSubject
    ' we are sending a text email.. simply switch the comments around to send an html email instead
    ObjSendMail.HTMLBody = strEmailBodyText
    'ObjSendMail.TextBody = "this is the body in text format"

    ObjSendMail.Send
    Set ObjSendMail = Nothing

    end sub

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles