Showing posts with label mail. Show all posts
Showing posts with label mail. Show all posts

Thursday, March 22, 2012

Strange issue with system.web.mail

Hello,

I have a strange issue when sending e-mails using system.web.mail. For an unknown reason every 990 character is a space in my message body. Not a big issue? Well, bigger then you can think. If the 990 character is in the middle of a HTML-tag, the message body is constructed wrong.

I tested this with the script you can find below. Try it yourself to see the result. I use Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300. My provider doesn't have another version available for me.

<%@dotnet.itags.org. Import Namespace = "System.Text" %>
<%@dotnet.itags.org. Import Namespace = "System.Web.Mail" %>
<script runat="server">
Sub SubmitEmail(sender As Object, e As EventArgs)
Dim sMsg as String
sMsg ="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"
sMsg+="123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-"

doEmail("name.to@dotnet.itags.org.yourhost.com", "name.from@dotnet.itags.org.yourhost.com", sMsg, "Test e-mail")
End Sub

Function doEmail(sTo as String, sFrom as String, sMsg as String, sSubject as String) 'Email component
Dim objEmail as New MailMessage
objEmail.To=sTo 'TO
objEmail.FROM=sFrom 'From

objEmail.SUBJECT=sSubject 'Subject
objEmail.BODY=sMsg 'Link Message body
objEmail.BodyFormat = MailFormat.HTML 'MailFormat.Text = RichText & MailFormat.HTML = HTML
SmtpMail.SmtpServer ="localhost" 'SMTP server
SmtpMail.Send(objEmail) 'Send message
End Function
</script>
<form runat="server">
<asp:Button id="Submit" text="Submit e-mail" OnClick="SubmitEmail" runat="server" />
</form>

Is this a known issue? What is the solution? I prefer not buying a e-mail component?

Thanks for your suggestions.

I don't know the answer - but have you tried stringbuilder. I have read about problems using string ( mostly performance related ) and that stringbuilder is the best choice ( for most string building situations)

This issue is solved. I found the solution here:

http://www.systemwebmail.com/faq/4.4.5.aspx

Usually you have a line in the body that is too long. The email rfc's state that a line should not contain more than 1000 characters. Try inserting a CrLf (vbCrLf for VB.NET or "\r\n" for C#) in your message body to break up long lines.

Tuesday, March 13, 2012

Strange problem in sending emails by asp.net

I use the following code to send email, and strange thing that I received the message at hotmail mail, and failed to receive it at yahoo mail , can you help me and explain what this happen and how to overcome this.


Regards
Serag Farag
PrivateSub Button1_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles Button1.Click

Dim msgmailAs System.Web.Mail.MailMessage

Dim SmtpMailAs System.Web.Mail.SmtpMail

msgmail =New System.Web.Mail.MailMessage

' SmtpMail =

msgmail.To = "elomah@dotnet.itags.org.yahoo.com"

msgmail.Cc = "ahmed_serageldin@dotnet.itags.org.hotmail.com"

msgmail.From = "ahmed_serageldin@dotnet.itags.org.hotmail.com"

msgmail.Subject = "subject of ggggggggggggggmsg"

msgmail.BodyFormat = System.Web.Mail.MailFormat.Html

msgmail.Body = " what u send mail ofgh ghgf ghr msgs"

SmtpMail.SmtpServer = "serag-0ivd22eow"

smtpmail.send(msgmail)

Response.Write("msg recived")

EndSub

Hello Serag and welcome to the forums.
First of all, if your email is received by Hotmail, then I don't thinkthere is a problem with your code. Maybe some wrong happened on its wayto Yahoo. Try to upload your script to a live server and then send theemail again.
Regards,


i saw the same problem in a diffirent thread i will check if i can find it for you but any way try what bilal suggest

try one of those links it might helps
http://forums.asp.net/916696/ShowPost.aspx
http://forums.asp.net/ShowPost.aspx?PageIndex=2&PostID=719622#719622
http://forums.asp.net/846879/ShowPost.aspx
and let me know if you solve it
good luck !!!

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);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
Kbenhavn, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"MMAS" <mustafashabib@.gmail.comwrote in message
news:1160783166.865336.327380@.h48g2000cwc.googlegr oups.com...

Quote:

Originally Posted by

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);
>


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:

Quote:

Originally Posted by

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
Kbenhavn, Danmark
>
"a Portuguese in Denmark"
>
Blog.http://balexandre.blogspot.com/
Photos.http://www.flickr.com/photos/balexandre/
>
"MMAS" <mustafasha...@.gmail.comwrote in messagenews:1160783166.865336.327380@.h48g2000cwc.g ooglegroups.com...
>

Quote:

Originally Posted by

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):


>

Quote:

Originally Posted by

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


>

Quote:

Originally Posted by

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


>

Quote:

Originally Posted by

Thanks!
-MMAS


>

Quote:

Originally Posted by

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


>

Quote:

Originally Posted by

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");


Quote:

Originally Posted by

SmtpMail.Send(mmAlert);


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" <mustafashabib@.gmail.comwrote in message
news:1160783166.865336.327380@.h48g2000cwc.googlegr oups.com...

Quote:

Originally Posted by

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";,

Quote:

Originally Posted by

"1");
>


mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusern
ame";,

Quote:

Originally Posted by

"[email address]");
>


mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassw
ord";,

Quote:

Originally Posted by

"some_pass");
// - smtp.gmail.com use port 465 or 587
>


mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserve
rport";,

Quote:

Originally Posted by

"465");
// - smtp.gmail.com use STARTTLS (some call this SSL)
>


mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusess
l";,

Quote:

Originally Posted by

"true");
>
SmtpMail.Send(mmAlert);
>


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
Kbenhavn, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"sloan" <sloan@.ipass.netwrote in message
news:%23wGQQWg8GHA.2128@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

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" <mustafashabib@.gmail.comwrote in message
news:1160783166.865336.327380@.h48g2000cwc.googlegr oups.com...

Quote:

Originally Posted by

>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";,

Quote:

Originally Posted by

>"1");
>>


mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusern
ame";,

Quote:

Originally Posted by

>"[email address]");
>>


mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassw
ord";,

Quote:

Originally Posted by

>"some_pass");
>// - smtp.gmail.com use port 465 or 587
>>


mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserve
rport";,

Quote:

Originally Posted by

>"465");
>// - smtp.gmail.com use STARTTLS (some call this SSL)
>>


mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusess
l";,

Quote:

Originally Posted by

>"true");
>>
>SmtpMail.Send(mmAlert);
>>


>
>

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/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);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
Kbenhavn, Danmark
"a Portuguese in Denmark"
Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"MMAS" <mustafashabib@.gmail.com> wrote in message
news:1160783166.865336.327380@.h48g2000cwc.googlegroups.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/smtpaut
henticate";,
> "1");
> mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/senduse
rname";,
> "[email address]");
> mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpas
sword";,
> "some_pass");
> // - smtp.gmail.com use port 465 or 587
> mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpser
verport";,
> "465");
> // - smtp.gmail.com use STARTTLS (some call this SSL)
> mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpuse
ssl";,
> "true");
> SmtpMail.Send(mmAlert);
>
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.com> wrote:
> 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=F8benhavn, Danmark
> "a Portuguese in Denmark"
> Blog.http://balexandre.blogspot.com/
> Photos.http://www.flickr.com/photos/balexandre/
> "MMAS" <mustafasha...@.gmail.com> wrote in messagenews:1160783166.865336.3=
27380@.h48g2000cwc.googlegroups.com...
>
>
>
>
>
>
authenticate";,
username";,
password";,
serverport";,
usessl";,
>=20
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" <mustafashabib@.gmail.com> wrote in message
news:1160783166.865336.327380@.h48g2000cwc.googlegroups.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);
>
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
Kbenhavn, Danmark
"a Portuguese in Denmark"
Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"sloan" <sloan@.ipass.net> wrote in message
news:%23wGQQWg8GHA.2128@.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" <mustafashabib@.gmail.com> wrote in message
> news:1160783166.865336.327380@.h48g2000cwc.googlegroups.com...
> mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpaut
he
> nticate";,
> mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/senduse
rn
> ame";,
> mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpas
sw
> ord";,
> mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpser
ve
> rport";,
> mmAlert.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpuse
ss
> l";,
>