473,405 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Set ContentBase in HTML Email using CDO

Hello All:

I am trying to understand how to set the ContentBase of an HTML email
I'm sending using CDO. The HTML source can be any .aspx page on on the
website. Basically, I'm creating an "Email This Page" link.

I am able to get the email sent just fine. However, all the images are
referenced using relative urls (which is what I prefer to use in all my
Webforms) and therefore, the image and style sheet references are
broken.

Isn't there a way to use the ContentBase property such that the
relative urls are referenced from a full url as specified through the
ContentBase?

My code is as follows:

*************************************

void Send_Email( object s, EventArgs e )
{
CDO.Message msg = new CDO.MessageClass();
msg.CreateMHTMLBody("http://localhost/mypage.aspx?print=Y",
CDO.CdoMHTMLFlags.cdoSuppressAll,"", "");
msg.To = emailTo.Text;
msg.CC = emailCC.Text;
msg.From = "in**@reactornet.com";
msg.Subject = "Thank You!";
msg.TextBody = "http://localhost/mypage.aspx?print=Y";

msg.Configuration.Fields[CDO.CdoMailHeader.cdoContentBase].Value =
"http://localhost";

msg.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value
= 2;

msg.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"].Value
= 25;

msg.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value
= "mail.cinemasolutions.com";
msg.Configuration.Fields.Update();
msg.Send();

Response.Redirect("~/forms/email_response.aspx");
}
Thank you in advance for your help.

Feb 7 '06 #1
0 1297

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
0
by: Carlos Ribeiro | last post by:
Hello all, While studying some of the templating systems available for Python, I've come up with an idea to implement templates using decorators. The following code snippet runs in Python 2.3; a...
5
by: BaWork | last post by:
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it...
4
by: clintonG | last post by:
Technically speaking, this issue is not about modifying the HTML generated by server controls but preceding the HTML generated by server controls with an HTML control generated on the basis of the...
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
9
by: Nathan Sokalski | last post by:
I am using ASP.NET 2.0's ImageMap Control to create 2 imagemaps, one directly below the other. When I do this a thin blank space appears between them. After several days of frustration I realized...
3
by: Erik Johnson | last post by:
THE GOAL: I need to send an email with a simple ASCII text body and an attached HTML file. I have scripts that send basic emails via the smtplib module that don't have any attachements and that...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
2
by: anu b | last post by:
Now i am sending email to my friend using session variable... but my code is as below private bool SendEmail(string email) { try
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.