Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 14th, 2003, 01:01 PM
Authorized User
 
Join Date: Jul 2003
Location: Franklin, Indiana, USA.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default Convert SMTPsvg.Mailer to JavaScript

I have found this VBScript to perform a mailer function that I need. I am having trouble converting this to JavaScript. All of my database functions are in Java and I REALLY DONT want to have to support both languages. The line I am unable to get to work so far is:

Mailer.AddRecipient "Recipient Name","Recipient@Address.com"

VBScript (this works great):

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Return Address Name"
Mailer.FromAddress = "Admin@xxxx.org"
Mailer.AddRecipient "Recipient Name","Recipient@Address.com"
Mailer.RemoteHost = "localhost"
Mailer.Subject = "Service Reminder"
Mailer.BodyText = "Text and text and text etc."
if Mailer.SendMail then
  Response.Write "Mail sent...Please check for mail"
else
  Response.Write "Mail send failure. Error was " & Mailer.Response
end if

JavaScript:

var Mailer = Server.CreateObject("SMTPsvg.Mailer");
Mailer.FromName = "Return Address Name";
Mailer.FromAddress = "Admin@xxxx.org";
Mailer.AddRecipient "Recipient Name","Recipient@Address.com";
Mailer.RemoteHost = "localhost";
Mailer.Subject = "Service Reminder";
Mailer.BodyText = "Text and text and text etc.";
if (Mailer.SendMail)
  Response.Write "Mail sent...Please check for mail"
else
  Response.Write "Mail send failure. Error was " + Mailer.Response

gives the following error:

Microsoft JScript compilation error '800a03ec'

Expected ';'

/EmailService/JavaMultipleEmails.asp, line 15

Mailer.AddRecipient "Rich Hoffmann","rich@hoffmannengineering.com";
--------------------^


Changing the offending line to:

Mailer.AddRecipient = "Rich Hoffmann","rich@hoffmannengineering.com";

yields:

Microsoft JScript runtime error '800a01b6'

Object doesn't support this property or method

/EmailService/JavaMultipleEmails.asp, line 15



Any insight will be greatly appreciated.

Rich


__________________
Ego is a faithful friend; He stays with us all the way to the crater.
  #2 (permalink)  
Old August 17th, 2003, 06:33 PM
Authorized User
 
Join Date: Jun 2003
Location: Quezon City, MM, Philippines.
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default

Hi,

You need to replace

    Mailer.AddRecipient "Rich Hoffmann","rich@hoffmannengineering.com"

with the following line:

    Mailer.AddRecipient("Rich Hoffmann","rich@hoffmannengineering.com");

You might also want to do it with the Response.Write's.

Cheers!


Marlon Villarama
Support Team
Web Burner Hosting
marlon@webburner.com
www.webburner.com
Toll-Free: 877-535-2876
  #3 (permalink)  
Old August 20th, 2003, 10:49 AM
Authorized User
 
Join Date: Jul 2003
Location: Franklin, Indiana, USA.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That got it! I figured is was something like that, but that is one iteration I did not try.

Thanks,
Rich



Similar Threads
Thread Thread Starter Forum Replies Last Post
convert Excel formula to JavaScript amwith Javascript How-To 3 March 7th, 2008 06:31 AM
Form mailer help dragonedge PHP How-To 0 August 13th, 2007 05:31 PM
Convert JavaScript OK/CANCEL to VBScript timmerdfw VBScript 0 January 4th, 2007 03:42 PM
Excel calculations convert to pdf via javascript evetteogden Javascript How-To 0 May 31st, 2006 11:32 AM
Convert an ASP page to JavaScript pigtail Javascript How-To 2 April 2nd, 2004 03:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.