473,738 Members | 3,854 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 = strRecipientEma il;
mmAlert.Priorit y = MailPriority.No rmal;

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

SmtpMail.Send(m mAlert);

Oct 13 '06 #1
4 3652
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.goo glegroups.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 = strRecipientEma il;
mmAlert.Priorit y = MailPriority.No rmal;

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

SmtpMail.Send(m mAlert);

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...@gm ail.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* *************** ******@h48g2000 cwc.googlegroup s.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 = strRecipientEma il;
mmAlert.Priorit y = MailPriority.No rmal;
SmtpMail.SmtpSe rver = "smtp.gmail.com ";
// - smtp.gmail.com use smtp authentication
mmAlert.Fields. Add("http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e";,
"1");
mmAlert.Fields. Add("http://schemas.microso ft.com/cdo/configuration/sendusername";,
"[email address]");
mmAlert.Fields. Add("http://schemas.microso ft.com/cdo/configuration/sendpassword";,
"some_pass" );
// - smtp.gmail.com use port 465 or 587
mmAlert.Fields. Add("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ;,
"465");
// - smtp.gmail.com use STARTTLS (some call this SSL)
mmAlert.Fields. Add("http://schemas.microso ft.com/cdo/configuration/smtpusessl";,
"true");
SmtpMail.Send(m mAlert);
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.goo glegroups.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 = strRecipientEma il;
mmAlert.Priorit y = MailPriority.No rmal;

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

SmtpMail.Send(m mAlert);

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.ne twrote in message
news:%2******** ********@TK2MSF TNGP05.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.goo glegroups.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 = strRecipientEma il;
mmAlert.Priori ty = MailPriority.No rmal;

SmtpMail.SmtpS erver = "smtp.gmail.com ";
// - smtp.gmail.com use smtp authentication
mmAlert.Fields. Add("http://schemas.microso ft.com/cdo/configuration/smtpauthe
nticate";,
>"1");
mmAlert.Fields. Add("http://schemas.microso ft.com/cdo/configuration/sendusern
ame";,
>"[email address]");
mmAlert.Fields. Add("http://schemas.microso ft.com/cdo/configuration/sendpassw
ord";,
>"some_pass") ;
// - smtp.gmail.com use port 465 or 587
mmAlert.Fields. Add("http://schemas.microso ft.com/cdo/configuration/smtpserve
rport";,
>"465");
// - smtp.gmail.com use STARTTLS (some call this SSL)
mmAlert.Fields. Add("http://schemas.microso ft.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
2054
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 the one email will arrive. I can send emails the traditional way to the problem domain and they arrive fine. Is there anything that might explain this? _______ Free Windows Clipboard Utility http://www.clipboardmagic.com/
1
8182
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 the members of my organization. I think my problem is incorrectly setting the settings on my server or an authentication problem. Here is the code I have written to send a test message: -----Code Begins: Sensitive Information Replaced by -----...
4
3856
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 wrongly being called twice. The weird part is that no "print" functions are being repeated, but any "lower" functions, such as fwrite or Pear::Mail::send are repeated twice. It is the strangest
3
2450
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 json-rpc, the letter generated include a mess. see the file with this letter
8
5048
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 is body of the mail.'
5
1609
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 VS2003 and i have iis 6 installed thanks for time and for ur fast reply
2
4167
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 reason I did this is because we are using a stored procedure on Server2 to send mail, as we have found that using mail on 2000 doesn't always work as advertised.
3
6009
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 want to send mail from my local machine to another user, bcos i am geeting this error msg in query analyzer... query:-EXEC master..xp_sendmail 'ss35934' (ss35934 is valid user name present into my local nerwork)
4
11777
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 this example: http://docs.python.org/lib/imap4-example.html Here are the configuration settings GMAIL says to use:
0
8787
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9473
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9334
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9259
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8208
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.