Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Defining oMail in CDOsys

Guest
Feb 22, 2009 Feb 22, 2009

Copy link to clipboard

Copied

I'm using CDOsys through my hosting provider (GoDaddy) to send an email when my Access database has been changed. The CDOsys code, as provided by GoDaddy, is within the insert command in DW; here's the code right before the CDOsys info and right after:

MM_editCmd.ActiveConnection.Close();

//body of email
mailbody = "the message goes here."

//Send the e-mail
MailMessage oMail = new System.Web.Mail.MailMessage();
oMail.From = "emailaddress@domainname";
oMail.To = "test@test.com";
oMail.Subject = "Test email subject";
oMail.BodyFormat = MailFormat.Html; // enumeration
oMail.Priority = MailPriority.High; // enumeration
oMail.Body = "Sent at: " + DateTime.Now;
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
SmtpMail.Send(oMail);
oMail = null; // free up resources

if (MM_editRedirectUrl) {

I get this error:
Microsoft JScript compilation error '800a03ec'
Expected ';'
MailMessage oMail = new System.Web.Mail.MailMessage();

How do I define oMail properly, using ASP javascript, to send the email?
TOPICS
Server side applications

Views

669
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Feb 23, 2009 Feb 23, 2009
thanks, I found it. The javascript ASP code is:


//Send the e-mail
{

var objMessage=Server.CreateObject("CDO.Message");
objMessage.Subject="Subject here";
objMessage.From="Email address here";
objMessage.To="Email address here";
objMessage.HtmlBody="<p>HTML content here.</p>";
objMessage.Configuration.Fields.Item(" http://schemas.microsoft.com/cdo/configuration/smtpserver")="Hosting provider's SMTP info here.";
objMessage.Send();
}

Votes

Translate
LEGEND ,
Feb 23, 2009 Feb 23, 2009

Copy link to clipboard

Copied

jennivazquez wrote:
> I'm using CDOsys through my hosting provider (GoDaddy) to send an email when my
> Access database has been changed. The CDOsys code, as provided by GoDaddy, is
> within the insert command in DW; here's the code right before the CDOsys info
> and right after:
>
> MM_editCmd.ActiveConnection.Close();
>
> //body of email
> mailbody = "the message goes here."
>
> //Send the e-mail
> MailMessage oMail = new System.Web.Mail.MailMessage();
> oMail.From = "emailaddress@domainname";
> oMail.To = "test@test.com";
> oMail.Subject = "Test email subject";
> oMail.BodyFormat = MailFormat.Html; // enumeration
> oMail.Priority = MailPriority.High; // enumeration
> oMail.Body = "Sent at: " + DateTime.Now;
> SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
> SmtpMail.Send(oMail);
> oMail = null; // free up resources
>
> if (MM_editRedirectUrl) {
>
> I get this error:
> Microsoft JScript compilation error '800a03ec'
> Expected ';'
> MailMessage oMail = new System.Web.Mail.MailMessage();
>
> How do I define oMail properly, using ASP javascript, to send the email?
>

That code is C# for ASP.NET websites. You'll need to ask Godaddy for the
Javascript code for ASP websites.

--


Julian Roberts

http://www.charon.co.uk

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 23, 2009 Feb 23, 2009

Copy link to clipboard

Copied

LATEST
thanks, I found it. The javascript ASP code is:


//Send the e-mail
{

var objMessage=Server.CreateObject("CDO.Message");
objMessage.Subject="Subject here";
objMessage.From="Email address here";
objMessage.To="Email address here";
objMessage.HtmlBody="<p>HTML content here.</p>";
objMessage.Configuration.Fields.Item(" http://schemas.microsoft.com/cdo/configuration/smtpserver")="Hosting provider's SMTP info here.";
objMessage.Send();
}

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines