473,498 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange problem using Gmail as mail server in ASP.NET

I've got my .net application set up to use gmail as a mail server (see
code below). Everything works quite well, actually, EXCEPT for one
particular email account. I've created an "admin" account that I'd like
to use to send emails from since GMail automatically replaces the
"from" field with whoever you're using to send emails from. When I use
this account, I get the following exception(s) (inner ones are
unraveled):

Could not access 'CDO.Message' object.
Exception has been thrown by the target of an invocation.
The message could not be sent to the SMTP server. The transport error
code was 0x80040217. The server response was not available

When i use my own personal gmail account, all is well. I have indeed
confirmed that my username and password are correct. :) Any ideas?

Thanks!
-MMAS

//code example
MailMessage mmAlert = new MailMessage();
mmAlert.From = strSenderEmail;
mmAlert.To = strRecipientEmail;
mmAlert.Priority = MailPriority.Normal;

SmtpMail.SmtpServer = "smtp.gmail.com";
// - smtp.gmail.com use smtp authentication
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate";,
"1");
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername";,
"[email address]");
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword";,
"some_pass");
// - smtp.gmail.com use port 465 or 587
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport";,
"465");
// - smtp.gmail.com use STARTTLS (some call this SSL)
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl";,
"true");

SmtpMail.Send(mmAlert);

Oct 13 '06 #1
4 3636
Google does not have a service for that, you will never accomplish this
cause Google Mail block external access from the Mail Servers

--

Bruno Alexandre
København, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"MMAS" <mu***********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
I've got my .net application set up to use gmail as a mail server (see
code below). Everything works quite well, actually, EXCEPT for one
particular email account. I've created an "admin" account that I'd like
to use to send emails from since GMail automatically replaces the
"from" field with whoever you're using to send emails from. When I use
this account, I get the following exception(s) (inner ones are
unraveled):

Could not access 'CDO.Message' object.
Exception has been thrown by the target of an invocation.
The message could not be sent to the SMTP server. The transport error
code was 0x80040217. The server response was not available

When i use my own personal gmail account, all is well. I have indeed
confirmed that my username and password are correct. :) Any ideas?

Thanks!
-MMAS

//code example
MailMessage mmAlert = new MailMessage();
mmAlert.From = strSenderEmail;
mmAlert.To = strRecipientEmail;
mmAlert.Priority = MailPriority.Normal;

SmtpMail.SmtpServer = "smtp.gmail.com";
// - smtp.gmail.com use smtp authentication
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate";,
"1");
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername";,
"[email address]");
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword";,
"some_pass");
// - smtp.gmail.com use port 465 or 587
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport";,
"465");
// - smtp.gmail.com use STARTTLS (some call this SSL)
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl";,
"true");

SmtpMail.Send(mmAlert);

Oct 14 '06 #2

sorry, but as i said in the message, that code works 100% if I use one
particular gmail account I have. I created a new account and tried
using that instead, but it does NOT work. besides the
username/password, the code doesn't change between those accounts.
On Oct 14, 5:01 am, "Bruno Alexandre" <bruno.in...@gmail.comwrote:
Google does not have a service for that, you will never accomplish this
cause Google Mail block external access from the Mail Servers

--

Bruno Alexandre
København, Danmark

"a Portuguese in Denmark"

Blog.http://balexandre.blogspot.com/
Photos.http://www.flickr.com/photos/balexandre/

"MMAS" <mustafasha...@gmail.comwrote in messagenews:11**********************@h48g2000cwc.g ooglegroups.com...
I've got my .net application set up to use gmail as a mail server (see
code below). Everything works quite well, actually, EXCEPT for one
particular email account. I've created an "admin" account that I'd like
to use to send emails from since GMail automatically replaces the
"from" field with whoever you're using to send emails from. When I use
this account, I get the following exception(s) (inner ones are
unraveled):
Could not access 'CDO.Message' object.
Exception has been thrown by the target of an invocation.
The message could not be sent to the SMTP server. The transport error
code was 0x80040217. The server response was not available
When i use my own personal gmail account, all is well. I have indeed
confirmed that my username and password are correct. :) Any ideas?
Thanks!
-MMAS
//code example
MailMessage mmAlert = new MailMessage();
mmAlert.From = strSenderEmail;
mmAlert.To = strRecipientEmail;
mmAlert.Priority = MailPriority.Normal;
SmtpMail.SmtpServer = "smtp.gmail.com";
// - smtp.gmail.com use smtp authentication
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate";,
"1");
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername";,
"[email address]");
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword";,
"some_pass");
// - smtp.gmail.com use port 465 or 587
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport";,
"465");
// - smtp.gmail.com use STARTTLS (some call this SSL)
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl";,
"true");
SmtpMail.Send(mmAlert);
Oct 15 '06 #3
See my
http://sholliday.spaces.live.com/blog/ 2/8/2006 ENTRY

I have 1.1 and 2.0 gmail/google mail smtp setup.


"MMAS" <mu***********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
I've got my .net application set up to use gmail as a mail server (see
code below). Everything works quite well, actually, EXCEPT for one
particular email account. I've created an "admin" account that I'd like
to use to send emails from since GMail automatically replaces the
"from" field with whoever you're using to send emails from. When I use
this account, I get the following exception(s) (inner ones are
unraveled):

Could not access 'CDO.Message' object.
Exception has been thrown by the target of an invocation.
The message could not be sent to the SMTP server. The transport error
code was 0x80040217. The server response was not available

When i use my own personal gmail account, all is well. I have indeed
confirmed that my username and password are correct. :) Any ideas?

Thanks!
-MMAS

//code example
MailMessage mmAlert = new MailMessage();
mmAlert.From = strSenderEmail;
mmAlert.To = strRecipientEmail;
mmAlert.Priority = MailPriority.Normal;

SmtpMail.SmtpServer = "smtp.gmail.com";
// - smtp.gmail.com use smtp authentication
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthe
nticate";,
"1");
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusern
ame";,
"[email address]");
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassw
ord";,
"some_pass");
// - smtp.gmail.com use port 465 or 587
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserve
rport";,
"465");
// - smtp.gmail.com use STARTTLS (some call this SSL)
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusess
l";,
"true");

SmtpMail.Send(mmAlert);

Oct 17 '06 #4
sorry, I can't see
your page crash Firefox completly!

I get an error and have to restart firefox.
good page :)

i'm using firefox 1.5.0.7

--

Bruno Alexandre
København, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"sloan" <sl***@ipass.netwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
See my
http://sholliday.spaces.live.com/blog/ 2/8/2006 ENTRY

I have 1.1 and 2.0 gmail/google mail smtp setup.


"MMAS" <mu***********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
>I've got my .net application set up to use gmail as a mail server (see
code below). Everything works quite well, actually, EXCEPT for one
particular email account. I've created an "admin" account that I'd like
to use to send emails from since GMail automatically replaces the
"from" field with whoever you're using to send emails from. When I use
this account, I get the following exception(s) (inner ones are
unraveled):

Could not access 'CDO.Message' object.
Exception has been thrown by the target of an invocation.
The message could not be sent to the SMTP server. The transport error
code was 0x80040217. The server response was not available

When i use my own personal gmail account, all is well. I have indeed
confirmed that my username and password are correct. :) Any ideas?

Thanks!
-MMAS

//code example
MailMessage mmAlert = new MailMessage();
mmAlert.From = strSenderEmail;
mmAlert.To = strRecipientEmail;
mmAlert.Priority = MailPriority.Normal;

SmtpMail.SmtpServer = "smtp.gmail.com";
// - smtp.gmail.com use smtp authentication
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthe
nticate";,
>"1");
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusern
ame";,
>"[email address]");
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassw
ord";,
>"some_pass");
// - smtp.gmail.com use port 465 or 587
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserve
rport";,
>"465");
// - smtp.gmail.com use STARTTLS (some call this SSL)
mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusess
l";,
>"true");

SmtpMail.Send(mmAlert);


Oct 19 '06 #5

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

Similar topics

6
2024
by: Mike the Canadian | last post by:
I am having a very strange problem sending email with php. I have two domains. I can send an email to one domain using php but not the other. If I put both email addresses in the mail command only...
1
8152
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
4
3840
by: Nate Murray | last post by:
Hey all, I'm having a strange PHP (4.3.10) problem that seems to have something to do with javascript. This is a bit complex, so hold on to your hats. My issue is that a single function is...
3
2435
by: astarocean | last post by:
i'm using maildrophost to sendmail and wrote a script for it when the script is called directly from web request , a letter geneated with right things but when the script is called from...
8
5023
by: NicolasG | last post by:
I'm using the following code to send e-mail through python: import smtplib fromaddr = 'myMail@gmail.com' toaddrs = 'myOtherMail@gmail.com' subject = 'someting for subject !' msg = 'This...
5
1591
by: Developer.Man4 | last post by:
when i try using HttpContext.Current.Server.MapPath(path) from a desktop application built using c# i get a System.NullReferenceException can anyone tell me why and what to do?? m using...
2
4155
by: sqlgirl | last post by:
Hi, We have 2 servers. Server1 is a 2000 box, with SP3 (yes I know it is not up to date). Server2 is a 2005 box, SP2. I set up Server1 (2000) to have a linked server to Server2 (2005). The...
3
5997
by: sachin shah | last post by:
hi all my query is how can i send mail by using sql server, i think by unsing xp_sendmail store procedure we can do this but my problem is what paramater to be pass to this store procedure if i...
4
11757
by: gregpinero | last post by:
I'm trying to get a list of messages from GMAIL using it's new IMAP access. So far I've tried running this command but it just hangs. Any ideas? I figured that's the first line to run from...
0
7121
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
7162
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
7197
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7375
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
5456
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,...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.