Use SMTPClient With GMail?
May 1, 2009I'm trying to send an email with the SMTPClient through a GMail account, but I'm having the problem that once I press the Send Button, the app freezes and I'm not getting any email.[code]...
View 7 RepliesI'm trying to send an email with the SMTPClient through a GMail account, but I'm having the problem that once I press the Send Button, the app freezes and I'm not getting any email.[code]...
View 7 RepliesI've got a vb program that sends an email using SmtpClient. I can't seem to get the message to pass the Proxy server (ccproxy). When sending thru outlook, I set the SMTP server to the Proxy server address, and in the username field I add a #and the SMTP server name following the username. I have tried several differt things here, but to no avail. Here is a sample of how I am trying to send this:
emailuserid = "me@mysmtp.com#mail.mysmtp.com"
emailpassword = "mypassword"
smtpserver = "192.168.0.1"
in my desktop application for sending mail I have used,
Dim obj1 As System.Net.Mail.SmtpClient
Dim Mailmsg1 As New System.Net.Mail.MailMessage()
[code]....
It was working fine but suddenly since from yesterday, 2 mails are sent by same obj1.Send() (In both the mails date time are same.) I have not changed code or used any loop for sending mail.
I would like to know if there is a simple way to capture a transcript of the SMTP session when sending email using the System.Net.Mail.MailClient. In cases where an error is generated (ex: relaying denied) I would like to display the whole transcript to the user.
View 1 RepliesI have tried multiple variations of the following code, but I still get the same result. I am trying to have the last line "Issue Description: ...." to appear on a new line. I have tried vbCrLf, vbCr, and & Environment.NewLine & _ None of which work.
Just a note: The other emails are properly formatted. Also, if I add put 2 vbCr (s) at the end of the 'Issue Title' line then it looks normal.This one in particular seems to be a thorn in my side.
The result:
The code:
Dim mail As New MailMessage()
Dim strbody As String
strbody = Nothing
[code]....
Inner exception is "Unable to connect to remote server". I don't understand what I did wrong[code]....
View 5 RepliesThis is my first time trying to create a windows application that can be used to send an email message. It's a new requirement that we have to satisfy. Our customer information is saved in a database and we needed to send them some advertisement messages to some or all of them.
I created a windows application but unfortunately I couldn't send a single email message.
I tried to modify my code several times with no luck; each time I'm getting a different exception message. I tried to search the wen for more information regarding this issue but I end up with the same result.
I don't know if I must have an smtp server to relay the messages and be able to send them. If this is the case how I can do that? Is it possible to accomplish this with something else.
Dim Message As MailMessage = New MailMessage()
Dim Smtp As New SmtpClient()
Dim SmtpUser As New System.Net.NetworkCredential()
[Code]....
I am using the SMTPClient in my VB.Net application to send emails. It appears it is getting an email signature from somewhere. Where does it get this signature? It looks like it is using an Outlook signature but our company no longer uses Outlook so the signature is wrong. Is there a way to remove the signature before sending the email?
View 1 RepliesI have an issue with the System.Net.Mail.SMTPClient class - when it sends an email via the Send method it does not seem to send the QUIT command after sending the email so the connection stays open indefinitely (or until the SMTPClient instance is disposed of by the garbage collector) as far as I can tell.I thought oh well I must just need to call Close or Dispose on it but neither of those methods exist This is very basic, standard SMTP server usage - every server should send QUIT after it is done sending the other commands used to transfer the email, otherwise the remote server keeps the session open (and some servers have a limit on how many sessions can be open at a time or how many emails can be sent per session) so this could cause some serious problems.
Am I being daft or does there seem to be no way to make it do what pretty much every other SMTP client in the world does? I found a Microsoft Connect topic that had been created about this but it was 4 years old and the response from MS was that they would probably include something in the next version of the framework... which is what we are now on
I am setting attributes for SmtpClient in program. It works fine in windowsxp but in windows7, it does not work every time. Some time it works and some time fails with failure message. Is there any known issue with SmtpClient in windows 7?
View 1 RepliesI've this small application I've built which loops thru our database and generates 30000 mails and sends them using System.Net.SmtpClient, but it's not working very well. At times it won't send for a couple of minutes, all in all it takes about 48 hours for all the mails to be sent. Our mail provider says it's because the mail server can only handle 10 connections simultaneuosly and that would be the reason why it halts. I've looked over the SmtpClient class but can't find any property to set max amount of connections. Does this problem sound familiar? Could that be the reason? If so, is it possible to set the max amount of simultaneous connections from the smtpclient to the mailserver?
View 4 RepliesI'm trying to create an application that sends an email to an smtp-server. The server is not set fixed, but will be looked up according to the domainpart of the email-address where the email should be sent to.
[Code]...
It would be quite useful, to know if the message was accepted by the mailserver and the message was successfully sent. What I am able so far is, that I can get the SMTP-Server error code (if there was an error (StatusCode 5xx) by using the System.Net.Mail.SMTPClient Object and its SendAsync Function. There, if there was an error, I get an Exception-Object in the Callback-Event of the SMTPClient
I'm well aware that not every mailserver will tell me if the mailaccount truly exists and then reject my mail with an errorcode but instead just accept the message and then delete it. Therefore I would be grateful for another Method to check if the mail was sent (note: not read, that would be the read confirmation)
The final purpose would be: Try to send an email to a recipient using it's domains mailserver and if it fails, proceed according to the errorcode (user does not exist -> abort / mailserver did not respond -> use another mailserver if available).
I am trying to send mail using SmtpClient() within my Winforms VB.Net program .Here is the code:
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
Dim _Attachment As String[code]......
For Host Name I using mail dot metaprosystems dot com, the user name and password are the user name and password I use to log into my mail server. This work when the To address is within my domain. For example bob at-sign metaprosystems.com. It does not work when I send to an email outside my domain. I get this exception in my catch block: "Mailbox name not allowed. The server response was: sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)"
Whether I include an attachment or not doesn't matter.I believe the problem is with my web hosting company, but so far they haven't come up with a solution. I need so advice as to what to tell them to do to fix this. Alternatively,
I have an issue where emails sent out via the SmtpClient class in .NET go directly into the outlook junk mail folder (Outlook 2003 and 2007). If I send the exact same email (same body, same subject, to and from the same accounts as I use in .NET) from Outlook itself, it will come in fine and not be marked as junk mail. The only difference is the extra headers that Outlook appends to the email when it is sent directly from Outlook.
[Code]...
I have a number of files that are generated in a function defined as:[code]These files are immediately printed and the files are automatically saved to a directory; the files themselves are not for use by the actual software users. I timestamp the files to keep them uniquely identified for auditing purposes.I've now received a requirement to email some of these files externally to the company, and someone has complained that the current filenames are not user-friendly.So, I tried copying the generated file to a temp directory, with a friendlier name, emailing the friendlier file, then deleting it, leaving my audit trail intact, like so: [code]This throws a System.IO.IOException on the line System. IO.File. Delete (friendly FilePath) because the file is still in use, after it has been emailed.I've taken out the email code, which makes the copying and deleting work fine, so it's apparently attaching the file to the email which causes the problem.I've also tried breakpointing before the delete line, waiting five minutes, confirming the email has been sent, then advancing the code, but the same exception is still thrown.
View 3 RepliesThe exact error I am getting in Visual Studio 2012 is:
error BC30456: 'Dispose' is not a member of 'System.Net.Mail.SmtpClient'.
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
SmtpServer.Port = 25
[code]....
This should be an obvious error. You would think I was using .net framework 3.5 or lower as Dispose() was only added as a member to SmtpClient in .net 4.0. However, I am using 4.0!In the website property pages it states 4.0. Is there somewhere else that I need to set as 4.0?
why this wont send...ive checked email address and password numerous times...
Imports System.Net.Mail
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Mail As New MailMessage
Mail.From = New MailAddress("myemail@googlemail.com")
[code]...
I have tried to write a program to get emails from my gmail account but no luck. Can you provide me with some code get all my emails from my account or a single one.
View 2 RepliesHow can I reseive or open my gmail messages by vb.net2008 code ???
View 4 RepliesI want to build an application for reading mails from gmail account using vb.net how do i
start?
I have made a program that send emails but know im trying t receive them. I have looked on google and things but i cant get it.
View 8 RepliesIn one of my open source apps, I have to work with gmail atom feeds.
Right now, I am using AES to encrypt the gmail password and store it. (the key is the MAC address of the system along with some hard-coded string.)
the security is highly compromised here.if anyone has access to the machine(thus the MAC address) and my source code(its open source), then he can get the gmail password.[code]...
actually my app will monitor the gmail account for mails over a period of time, so if I don't save the password the I'll have to ask the user to enter the password every time the program starts.
I have a problem sending an email using gmail.. the code I use is the following :
[Code]...
Can't connect to server is what I get out of this: Public Sub SendEmail()
Dim client As New SmtpClient()
Dim sendTo As MailAddress = New MailAddress(TextBox1.Text)
Dim from As MailAddress = New MailAddress(User(SendFrom) & "@gmail.com")
Dim message As New MailMessage(from, sendTo)
[Code]...
How can I, download attached files from unread received mail , by VB code.
how do i access my inbox and find emails that were sent from a specific person and send a reply to them?i have a list of people with whom i keep in touch with from school and since i have not replied to them in a while, i would like to feed a list of email addresses into the program that would then find emails from those people and it would reply to those emails?
View 1 RepliesI am trying to send an email through following code
CODE
Dim MyMailMessage As New MailMessage()
'From requires an instance of the MailAddress type
MyMailMessage.From = New MailAddress("a@gmail.com")
[Code]....
NOTE : I have tried SMTPServer.Port = 587 too but still its not working
Im tyring to do an application like outlook to send and receive e-mails.
View 1 RepliesI'm trying to connect up Outlook Express to gmail. Ihave inspiron 9100 with the XP sp2 system. I don't have access to anything else. I think the problem is around gmails inbox parameters but I'm unsure. All I'm sure of is that I am unable to read mail. I have full privileges under this copy of XP.
View 18 RepliesIs there any way I can make a vb.net application that will allow me to retrieve the gmail inbox into my Application? I can use gmail Smtp server to send the mails, the problem I am facing is that I cant receive the mails from gmail to my application?
View 39 Replies