 |
|
|
 |
|
 |
Can this code working in window form? thanks
|
|
|
|
 |
|
 |
Hello Guys. Thank you for this Forum you Put Up. its been very Helpfull.
I have a problem with sending emails from my Asp.Net Application. I am working on a web Application where New users are to sign up and a Confirmation Email is sent to Them Showing their UserName, Password and Activation Number.
i Used the HelpMail Class Posted on your Forum. The Code Runs Completely without any error and i Suppose the Mail Has been Sent but when i Check The inbox of mail box i sent it to, No Messages is found, i also check the spam mail section and no messages either.
I use Yahoo and Gmail. Niether of them gets the Message.
Now this is My network Setup:
I Have a Proxy Server with 2 Network Cards. NIC Card1(WAN)'s Address: 41.xxx.xxx.xxx and NIC card2(LAN):96.xxx.xxx.xxx
My ASP Development System NIC cards is Also 96.xxx.xxx.xxx and i connect to the internet through the Proxy or Gateway-server. in the web.config file i tried sending with 41.xxx.xxx.xxx ip as the Host address see my config bellow. it still doesnt work. please i need help.
<-- these settings define the mail server settings
from: the user name from which the email is sent - this is the
application that is sending the message
host: the name of your mail server
userName: the name the application will use to log into the mail server
password: the password for the above user name
-->
|
|
|
|
 |
|
 |
How can i retrieve email (message and attachment) which i have received by download it with my .Net application?
Thank You in advanced
|
|
|
|
 |
|
 |
I use a similar process in VB.NET 2003 (ASP.NET) which works fine but was wondering why you needed to overload the method. Wouldn't you simply parameterise the number of elements in the array(s) and loop through them as you're doing here? This would still give you one to many recipients and one to many attachments without having to duplicate the code. Or have I missed something in the intent of this code?
|
|
|
|
 |
|
 |
I m getting the error like enable to read data from the transportconnection: An existing connection was forcibly closed by the remote host. System.net.sockets.socketexception
|
|
|
|
 |
|
 |
I have put this code in a service and it compiles fine and executes when I install but no email. Any thoughts?
Thanks
Randy
|
|
|
|
 |
|
 |
I am Having The Same Problem. I Check the Mail Box i sent the mails to from my asp.net and there was no New mail in Inbox nor in Spam Mail Section. please i need Help. just so you know,I used the Sendemail class i get No errors
|
|
|
|
 |
|
 |
How can you tell if it actually hits the smtp server? I tried typing gibberish in the " SmtpMail.Host" and it still executed fine, so I know it is not checking it.
|
|
|
|
 |
|
 |
what is this IP address?
Thanks
|
|
|
|
 |
|
 |
That is a sample! you are supposed to replace it with your settings; eg 127.0.0.1 or mail.you.com
|
|
|
|
 |
|
 |
Hi,
Do you know how to stop email from ending up in Junk Box?
Currently have problem with VET anti-virus and Vista.
|
|
|
|
 |
|
 |
im sorry, i was trying to use you procedures and added to my common class but everytime i try to send out an email from my windows application it prompts the error => "Invalid URI: The format of the URI could not be determined.". Or is this only applicable to ASP.NET. thanks in advance.
Do not take life too seriously. You will never get out of it alive.
|
|
|
|
 |
|
 |
When I add this code, it only sends the email after I close the form. Any idea why? I have placed this in both the load and a button click event but the same thing. Thanks.
|
|
|
|
 |
|
 |
Hi,
I'm trying to use your module, but I keep getting errors.
The details of the error are:
-----------------
System.Net.Mail.SmtpException was unhandled
Message="Failure sending mail."
Source="System"
StackTrace:
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at AD_PS_Checker.SendEmail.SendEmailMessage(String strFrom, String[] strTo, String strSubject, String strMessage, String[] fileList) in D:\Visual Studio 2005\Projects\AD_PS_Checker\V1.1\AD_PS_Checker\AD_PS_Checker\SendEmail.vb:line 30
at AD_PS_Checker.FrmControl.SendMail() in D:\Visual Studio 2005\Projects\AD_PS_Checker\V1.1\AD_PS_Checker\AD_PS_Checker\FrmControl.vb:line 838
at AD_PS_Checker.FrmControl.FrmControl_Load(Object sender, EventArgs e) in D:\Visual Studio 2005\Projects\AD_PS_Checker\V1.1\AD_PS_Checker\AD_PS_Checker\FrmControl.vb:line 853
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at AD_PS_Checker.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
---------------
but in the inner exeption, I can find the line "No connection could be made because the target machine actively refused it".
I've tried both our Exchangeserver as a Unix SMTP box. On the Unix box, no auth. is needed and the administrator of that box told me that it is configured open to accept all SMTP requests.
I also did try to add SmtpMail.Credentials = New System.Net.NetworkCredential("username", "password"), but still the same.
Do you have any idea what can cause this problem and how to solve it?
Thanks,
Micha
|
|
|
|
 |
|
 |
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Nothing is Impossible in Life Need Is Try for It
Think Big Get Big
Don’t Forget To Rank Best Post
|
|
|
|
 |
|
 |
I have error message next to "Encoding.Default"
Any idea.
it seams to be a declaration.
Greetings Wolfgang
|
|
|
|
 |
|
 |
This is a new property in the .net framework 2.0. Make sure user are not using the 1.1 framework.
Could you post the error message or the exception details?
|
|
|
|
 |
|
 |
Error 1 Name 'Encoding' is not declared. D:\Visual Studio 2005\Projects\EMAILSMTP\SENDEMAIL.vb 12 40 EMAILSMTP
I have the Express Edition and only the framework 2.0
Wolfgang
|
|
|
|
 |
|
 |
Try using the full qualified name
MailMsg.BodyEncoding = System.Text.Encoding.Default
If you continue to have problems then try removing that line and it should still work. The reason for that line of code is to make sure the encoding is set to UTF8.
|
|
|
|
 |
|
 |
That works fine ! Thank you.
I had a problem with item = nothing in your example
item(o) = ok
item(1) = ok
item(2) = nothing
Maybe there are String-differences in the releases.
May help looks like this.
If item = Nothing Then
Else
your code
end if
Thanks for your help
Wolfgang
|
|
|
|
 |
|
 |
Use:
MailMsg.BodyEncoding = System.Text.Encoding.Default
|
|
|
|
 |
|
 |
You need to import the System.Text namespace at the top of your Class.
|
|
|
|
 |
|
 |
Nice but majority SMTP servers want authorization before sending emails.
And try to write code with authorization which will work when smtpClient.Credentials = new NetworkCredential("UserName","Password")
is not working.
Jantac
|
|
|
|
 |
|
 |
You are correct, authorization would be required if you are sending email directly to the SMTP server. However, this issue can be avoided by using an internal SMTP relay. If you use an internal SMTP relay then you can send mail to internal or external email addresses without authentication and still have the relay behind your firewall.
|
|
|
|
 |