www.webdeveloper.com
Results 1 to 2 of 2

Thread: Send an email with Arabic characters using SMTPsvg.Mailer

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Posts
    92

    Send an email with Arabic characters using SMTPsvg.Mailer

    I am trying to send an email with Arabic charcters using SMTPsvg.Mailer. Is it possible?

    Here is my code:

    Code:
    set mailObj = Server.CreateObject("SMTPsvg.Mailer")
    	   'set mailObj = Server.CreateObject("Persits.MailSender") 
           mailObj.FromAddress = fromAddr
           mailObj.RemoteHost  = smtpServer
           mailObj.ReplyTo = fromAddr
        
             mailObj.AddRecipient "", Trim(sToAddress)
        	MailObj.CustomCharSet = "windows-1256" 
    		
           mailObj.Subject = sSubject
           'mailObj.ContentType = "text/html"
           mailObj.BodyText = sBody
           if not mailObj.SendMail then
             SendMail = "Email send failed: " & mailObj.Response & "."
           end if
    I have set the customCharSet to "windows-1256" (Arabic), but when I check the email on the recieving end, it just comes out as a bunch of ?????? symbols.

    Doing a google search, I find that a lot of people seem to be using CDONTS.Newmail instead of SMTPsvg.Mailer for sending emails with Arabic, is this because it can't be done using SMTPsvg.Mailer? If so, to use CDONTS, do i need to have something installed on the server?

  2. #2
    Join Date
    Oct 2008
    Posts
    92
    I have worked out a solution using CDO, tested it and it works, here it is:

    Code:
    on error resume next
     dim mail
     set mail=server.createobject("CDO.Message")
     mail.from=fromAddr
     mail.to=sToAddress
     mail.subject=sSubject
     mail.bodypart.charset="utf-8"
     mail.htmlbody=sBody
     
     mail.Configuration.Fields.Item _
     ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
     'Name or IP of remote SMTP server
     mail.Configuration.Fields.Item _
     ("http://schemas.microsoft.com/cdo/configuration/smtpserver")=smtpServer
     'Server port
     mail.Configuration.Fields.Item _
     ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 
    mail.Configuration.Fields.Update
     
     mail.send()
     set mail=nothing

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