Sending mail via SMTP Authentication

hi I had problem sending mail using mailer but found work aroud. You might find it usefull.
Example
The following example shows how to send an e-mail through an SMTP server that requires authentication server over the network by providing credentials in clear-text.
using System;
using System.Web.Mail;
namespace SMTPAuthentication
public class SMTPAuthenticationExample
  public static void SendMail()
   string smtpServer = "smtp.domain.com";
   string userName = "johnDoe";
   string password = "pass";
   int cdoBasic = 1;
   int cdoSendUsingPort = 2;
   MailMessage msg = new MailMessage();
   if (userName.Length > 0)
    msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer);
    msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25) ;
    msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort) ;
    msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);
    msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", userName);
    msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password);
   msg.To = "[email protected]";
   msg.From = "[email protected]";
   msg.Subject = "Subject";
   msg.Body = "Message";
   SmtpMail.SmtpServer = smtpServer;
   SmtpMail.Send(msg);
taken here
http://support.microsoft.com/kb/555287

Thank you very much for sharing your findings with the community, Oleksiy!
We definitely appreciate that!
Regards,
Frank

Similar Messages

  • I send mail via SMTP server with Hebrew text, and I get it gibberish on my iphone

    I send mail via SMTP server with Hebrew text, and I get it gibberish on my iphone

    What mail program from what kind of computer are you sending your email?  It sounds like an encoding problem that would have to be solved on the sending end.   If you want, send me an example of the kind of email which arrives as gibberish on your iphone (tom at bluesky dot org).

  • I have a problem sending mail via smtp. I use a satellite system and the average return time for a ping is 675ms. Is this a problem with mail? If so can I change Mail to accept it. The problem also exists with Lion

    I have a problem sending mail via smtp. I use a satellite system and the average return time for a ping is 675ms. Is this a problem with mail? If so can I change Mail to accept it. The problem also exists with Lion and on both my MacPro and my wife's Imac. I also see my mailboxes randomly disconnecting and reconnecting. Any other ideas of a possible cause?

    I solved it myself, after the "note" which came back from FF/Mozilla just as I finished my message, commenting on what it was that my system had , I wnnt back to check my plug-ins etc. I downloaded the latest Java, BOTH 32bit AND 64 bit versions and latest Firefox.
    Now all is working.
    Thanks,
    B.

  • Java mail api: SendFailedException when trying to send Mail via SMTP

    Hello,
    I'm trying to send a mail via java mail api using a server that requires smtp authentication.
    I'm currently using the following code:
    protocol = "smtp";
    host = "auth.smtp.profimailer.de";
    port = 25;
    String from="[email protected]";
    String to="[email protected]";
    props.put("mail.smtp.host", host);
    props.put("mail.smtp.auth", "true");
    Authenticator auth = new PopupAuthenticator();
    session=Session.getInstance(props,auth);
    MimeMessage message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from,"[email protected]"));
    message.addRecipient(Message.RecipientType.TO,new InternetAddress(to,"ToName"));
    message.setSubject("Hello JavaMail");
    message.setText("Welcome to JavaMail");
    Transport.send(message);
    static class PopupAuthenticator extends Authenticator {
            public PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication("e12345676", "mypass");
    }When trying to run this code, I get the following exception:
    D:\eclipse30RC1\workspace\ClassifyIt\bin>java -cp .;../lib/javamail.jar de.jwannenmacher.classify.TestMail > test.txt
    javax.mail.SendFailedException: Send failed;
    nested exception is:
    javax.mail.SendFailedException: Sender "[email protected]" <jens
    @jens-wannenmacher.de> was rejected: 501
    at javax.mail.Transport.doSend(Transport.java:223)
    at javax.mail.Transport.send(Transport.java:92)
    at de.jwannenmacher.mail.pop3client.POP3Client.getAllNewMessages(POP3Cli
    ent.java:176)
    at de.jwannenmacher.classify.TestMail.main(TestMail.java:22)
    Any suggestions on this?
    Thanks and best regards,
    Jens

    Hi,
    yes smtp is a standard and I think you could use this with almost every smtp server.
    If your smtp server doesn't require authentication you can access it without an authenticator
    I think...
    Best regards,
    Jens

  • Configuring mail priority when sending mails via SMTP from ECC 6.0 system

    hi all,
    we have the problem, that mails which we send via SMTP out of ECC 6.0 system
    reach our SMTP server with very low priority. So the server usualy send them in the evening.
    Is there a possibility to configure global priority for mails?
    best regards
    Davor

    Goto SCOT transaction, double click on STMP you will find the option
    Maximum waiting time for repeat send attempt procedure:
    Hours/minutes       / 30. define the time over there.
    II option execute the job- start send process,
    Regards,
    Mahesh

  • Send a mail via smtp without authentication

    Hello,
    I'm developping a web application that reports errors or 'strange situations' to the application'a admin with an e-mail message to the address entered in a sort of wizard. I've read some tutorials and actually I'm able to send mail via smtp only with authentication, withouth i get this error: "530, Address requires authentication". How can i send mails without authentication?

    Normally the administrator of those forums is also the administrator of the SMTP server they use, so they configure the server to accept requests from the forum software without authentication.
    If you are running your own SMTP server you can do that too. If you are using somebody else's server you will have to follow their rules. You could always contact the administrator and ask whether you could be made exempt from authentication...

  • HELP! HELP! Please.... Cannot send email via SMTP....

    Hi,
    Not posted here before but this really is a last ditch attempt to get my email working. I'm at my wits end with this.
    I reported a problem that I could not send mail via SMTP (with Outlook) last December (2014). I kept getting a message from the mail server stating "421 Too many messages". They guys on live chat tried for an hour to get it working, finally gave up and told me to use WebMail instead. Ok, that worked but... in January that went off completely and I found that BT had removed my mailbox from the system!
    It's now 19th March 2015. Today, (yes 3 months later) my mailbox finally came back online. At last I could catch up on all my lost messages, lost business and everything else that was important (yep all my old messages were THERE!).
    BT support have been useless, in fact, more than useless. I'm abroad working at the moment and I've had to make many international calls to the UK to bitterly complain about this. They won't call me - they will only call a UK number so all the cost, plus the lost business and everything else is at my cost. So, webmail is working. I went to set up my Ouitlook client and guess what...?  I have the SAME error message. The client is connecting but error is the same. 
    421 is a SERVER message which is telling me that the BT Mail server is not configured for enough connections. Either that or it's severely overloaded. This is BT's problem - not mine but all BT have done is fob me off with excuses for 3 months and now I'm back to square one. the support guys have no idea what this message means.
    Today I was told that if I wanted it sorted I had to pay for BT Expert help.
    What???  I don't need an "expert". I just want them to configure their server properly!
    Can ANYONE - anyone from BT please, please help me to get this sorted. I'm tearing my hair out and as you may have guessed by now I'm also very angry about this.
    I've tried making an online official complaint but that came to nothing as they told me as it was Outlook they couldn't help. Maybe it was set up wrong. It's not set up wrong - I'm a Network Engineer!!  I've set up hundreds of Outlook accounts! The SERVER error message is like a big flashing sign stating that it's a BT issue. Why will no-one listen to me???  Why will they do nothing at all?  This problem has been posted many times. Why is it not sorted?
    Anyone???
    Solved!
    Go to Solution.

    Yes of course I've contacted the Premium Mail help number. I've called them many, many times without any success at all and since I've been calling from abroad it's cost me a fortune to get nowhere.
    These forums are for the BT Community. I'm part of the community since I still have BT services. This isn't a Broadband forum. As I've indicated though, I've been with BT for over 35 years so I think that entitles me to some sort of service - even from here if possible.
    There is no issue with my account according to the BT staff. This has been checked and all is fine. The issue is that they are refusing to acknowledge that there is a problem although there clearly is one.
    However.... your statement: 
    It also possible that you are being stopped from using BTs SMTP server, because you are not actually connected to  BT Broadband. You would therfore be restriced to using webmail only.
    ... is new to me. No-one has told me that.
    One has to then beg the question: "If you can only use so-called Premium Mail via the web then why are BT not telling people that?"  No-one seems to know - even you Keith, say that "it is also possible...."
    If this actually IS the reason then I could have been told that from the beginning.
    Unfortunately, error 421 is one of the more "unspecific" codes generated by mail servers. This error can mean many things. It can show misconfiguration but it doesn't show up as a security lockdown - even though it could be. What I can't understand is why no-one actually knows. No-one can explain absolutely and that's what is really annoying here.
    No-one will take responsibility and no-one is willing to even try to help me out here - that's what is really bad.
    Keith, you've come up with something which makes sense that may well explain the issue - but the question is really: "What can I do about it?". 
    Nothing?  I just have to put up with it?  Great customer care....

  • HT6114 Why would i lose the ability to send mail via my mac? smtp is offline

    Why would i lose the ability to send mail via my mac? smtp is offline and cannot get it to respond.  I have web mail with o2, which is working fine, and i can send and receive on my iPhone!! yet i cannot send on any of the four accounts i have via mac?

    Troubleshooting sending and receiving email messages
    Troubleshooting sending email messages

  • Can't send mail via mail

    Greetings O Wise Ones,
    The smtp setting are correct. I can receive mail. The mail app was working fine one minute and the next I couldn't send mail. Tried a new smtp and it didn't work either, Created a new login user and new mail. The smtp work with the new user but not with the old one. Any ideas that don't delete the com.apple.mail.plist? If that's the only way. How do I save my mail boxes?

    This is happening to my wife's Leopard 10.5.8 upgraded machine right now.
    We've been using Apple Mail for years and it works, but suddenly stopped working
    and refuses to send mail via any SMTP server at all. It just spins forever and eventually
    complains it can't.
    The account is configured to send via comcast (smtp.comcast.net), DSL (smtp.sbcglobal.yahoo.com), and gmail, as choices. Two of them require authentication, Comcast doesn't require authentication, only that the e-mail be sent via the Comcast cable router, which it is.
    I've tried removing the SMTP accounts and carefully re-adding, removing the Gmail IMAP mail account itself in Apple Mail and re-adding, and even moving aside the /Users/<user/Library/Mail folder so it can be re-added. I've even used the sqlite3 index vacuum command.
    On my own Mac Pro, 10.5.8, I'm able to send e-mail, but on the notebook mail is wedged up for good and it seems to be associated with the upgrade. I am now re-installing 10.5.8 from the 'combined' download, and I'll see if it fixes it. What a hassle.

  • Sending mail via forms no longer working

    Recently, on one of our servers (XServe G4 - 10.3.9) was running both web and mail. Mail was moved off of the server 2 days ago onto a newer server (10.4.7)
    The web server has: php4.3.11 and is ONLY running AFP/OD/Web
    Since the transfer of the mail server to the new machine, all web sites can no longer send mail via their scripts (either by sendmail, php's mail(), or by connecting to SMTP server via php).
    The web logs do not show errors when it attempts to send the mail...
    A look at mail.log shows
    "relay=cyrus, delay=2558, status=deferred (temporary failure. Command output: couldn't connect to lmtpd: Connection refused_ 421 4.3.0 deliver: couldn't connect to lmtpd_)
    As far as I'm aware, the web server/sendmail shouldn't be attempting to use cyrus at all. For the record, Cyrus master is not running.
    All users can access the mail server without any difficulty. DNS entries have been checked and double checked.
    Does anyone know why sendmail and php mail functions stopped working? I really need to get these web forms functioning again. Is the problem with apache, php, sendmail or something else?

    Hi Camelot,
    Thanks for the quick reply and useful suggestion. I did as you mentioned and fired up the mail server.
    The mail "delivered" however, I notice a couple issues in the logs (mail.log)
    issue #1: I have to start cyrus master manually via > sudo /usr/bin/cyrus/bin/master SA and command line start/stop of mail does not start master. Also, when starting master from command line as mentioned, terminal hangs.
    issue #2 (from mail.log) - still getting the same lmtpd error (but messages do finally get delivered):
    Jan 14 03:58:24 www postfix/pipe[2914]: 3503858502D: to=<[email protected]>, relay=cyrus, delay=5327, status=deferred (temporary failure. Command output: couldn't connect to lmtpd: Connection refused_ 421 4.3.0 deliver: couldn't connect to lmptd_ )
    Jan 14 03:59:39 www postfix/cleanup[2906]: B60AE58572B: to=<[email protected]>, relay 123.123.123.123[123.123.123.123], delay=0, status=sent (250 Ok: queued as 9FBF41BCBCA)
    Do you think these are "issues" to contend with or are they "normal" occurances?

  • SMICM error while sending mail using SMTP server

    Hi All,
    We are not able send mails using SMTP server.
    We have made every settings necessary in SCOT, SO16 , SMTP service is activated, default domain is maintained etc
    Only things which seems to be wrong is in SMICM trace file.
    [Thr 13] *** ERROR => NiBufIConnect: non-buffered connect pending after 5000ms (hdl 29;10.26.24.44:1090) [nibuf.cpp    4608]
    [Thr 13] *** WARNING => Connection request from (0/1/0) to host: 10.26.24.44, service: 1090 failed (NIECONN_REFUSED)
    [icxxconn_mt.c 2321]
    This error is getting repeated in it.
    BUt I am not sure why it it trying to hit 10.26.24.44, as we dont have any server by this ip. The ip is only not resolvable from the server.
    1 more thing, at OS level, following parameter is maintained in profile :
    icm/server_port_1 = PROT=SMTP,PORT=25000,TIMEOUT=180
    But in SCOT, under SMTP node PORT is given as 25.
    Kindly let me know what going wrong here?
    Thanks

    also getting error as follows
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

  • Cant Send Mail via DSL

    Im Apple Mail using iMac G4 and G4 tower. Both will recieve an send mail find via dial-up but will not send mail via dsl connection.
    We get our mail via ethernet > router > antenna > atenna > another router > antenna > ten miles away at another antenna then to dsl source.
    So our dsl connection/signal is going threw three other antennas and at least one router here in office before we get it.
    My ISP provider says we need to talk to our DSl provider.
    Any ideas? Our computer tech is out of office touch for a week.
    Ran

    Thanks but this doesn't answer my question.
    Allan, I am 99% percent sure that my ISP is not the same ones who supply our ethernet/broadband/DSL.
    Is your internet service provider (ISP) for your
    dial-up connection different from the ISP for the DSL
    connection?
    Yes, I believe that they are differrent, however, I have new info.
    At first my G4 tower with Earthlink account would not send out over etherner/broadband/DSl, but now it does! I, nor anyone else, has made any changes to the outgoing address that works for dial-up connection and is what we have always used until yesterday when we first tried the dsl/braoband
    Kind of a different situation and not typical or the
    norm to have a company that provides a DSL connection
    not be the internet service provider for the
    connection.
    Someone new came into our building for office space. He had the router, ethernet cables and antenna installed. He/we get electro-magnetic radiational signal from a larger business across the street who has a tower --soon to be a taller tower-- and they get there radiational signal from 10 miles away.
    Knowing who your ISP is for connecting to the
    internet regardless if using a dial-up connection or
    a DSL connection (DSL is considered a broadband) is
    important and if the email account and SMTP server
    being used is provided by the ISP being used for your
    internet connection or by a different email account
    provider not associated with the ISP used for
    connecting to the internet.
    Yes, I understand that is the case. Maybe I'm wrong and by some coincidence the DSL provider is Earthlink and that is why the G$ tower account began working for the outoging mail.
    Im still having the sam problem on the G4 iMac which is a local.com account they have told us the same as you have, that we need to know who the DSL provider is and what info they require in the outgoing( smtp ) line.
    You mentioned Earthlink which is an internet service
    provider that offers dial-up access and/or DSL access
    so does the Earthlink protocol you mentioned mean you
    are having problems sending with an Earthlink email
    account and SMTP server?
    Earthlink account is working now so again perhaps the DSL provider is coming through Earthlink and ergo we didnt need to make changes to the outgoing( smtp ) info line.
    Thats the only way that one can be explained.
    I take it you use the dial-up connection at home
    (which is provided by Earthlink?) and the DSL
    connection is used at the office?
    Thats correct. The inital DSl source for the business that is 10 miles away, must use Earthlink. I'm now presuming this is the case with this new info.
    However, there is another --3rd-- business on other side of street and he uses --Apple mac just like me-- and his ISP is "host centric". I looked at his mac preference accounts outgoing ( smtp ) line and his is
    "mail.the business name.com:his email address",
    i.e. he does not use Earthlink but he has no problem sending out mail via the same DSl/broadband connections we have
    The only reason he has his address in the outgoing mail liine is bceause he too is in larger business building with several differrent computers and email address's.
    I've tried all kinds of combinations that are similar to the Earthlink outgoing and the hostcentric outgoing
    but none work for the local.com account.
    The exact error message provided when trying to send
    messages is also pertinent information.
    "message delivery failed" "the attempt to read data from the server 'server-name' failed"
    Then it gives me option to try differrent server names.
    Thanks for your efforts Allan and ohters.
    Ran

  • Outgoing mail without smtp authentication

    My mail account uses an outgoing smtp server which does not require any authentication but IOS5 does not have this option (only various forms of authentication) - how do I set up an outgoing server without authentication

    so send me some code or link with which i can send mail with smtp authentication

  • Surname not recognized when sending mail via FM

    Hi SDN,
    I am on WAS 6.20. SRM System.
    I have a BSP, which sends mail via FM SO_NEW_DOCUMENT_ATT_SEND_API1.
    when putting a normal dialog user in the ICF Service of the BSP I get a mail in my email client, which shows as sender the forename, surname of the corresponding SU01 SAP User. When putting service user in the ICF service the sender, which shows up in my email-client is always 'www' even though I changed fore- and surname of this service user. Why is that?
    regards, matthias
    Message was edited by: Matthias Kasig
    Message was edited by: Matthias Kasig

    I am with you. I think they still have a dud server in their farm and when you get it you get the error message. How to get to level two support is the trick I think.

  • Error while sending mail through SMTP

    Hi,
      We are getting the following error while trying to send mail through SMTP.
    '554 ERROR_MESSAGE_STATE: SMTP_NO_HANDLER( host:1-,subrc:0001)'
    Please advice,
    Regards,
    Sam

    Hi All,
      Configured SMTP as per the note 455140,i can able to send mails from SAP to the out side world,
    mails in SAP.When i tried the test to check whether the SAP system is correctly set up to receive e-mails as per the note 607108, iam getting a connection closed message as below.                                                                           
    afgdev:pgdadm> telnet afgdev 2500                                          
    Trying...                                                                  
    Connected to afgdev.                                                       
    Escape character is '^]'.                                                  
    220 afgdev.abc.ae SAP 6.40(52) ESMTP service ready                   
    helo afgdev                                                                
    250 afgdev.abc.ae                                                    
    mail from:<[email protected]>                                      
    250 Ok                                                                     
    rcpt to:<[email protected]>                                 
    250 Ok                                                                     
    data                                                                       
    354 Enter mail, end with "."                                               
    Hello,This is a test.                                                      
    Connection closed.                                                         
    afgdev:pgdadm> 
    rgds
    Sam

Maybe you are looking for

  • Creation of Multiple Shipments with respect to Single inbound.

    Hi, This is regarding creation of Multiple Shipments with respect to Single inbound. In standard SAP, you can create Shipment cost based on Inbound number.Requirement is here for single inbound can we create multiple Shipment document. Can we do ship

  • Generating a random password and sending a userid through mail to the user

    HI, I have a field named UserID in the process form,this user id can only be accessed by the GIA PROVISIONING ANALYST for updation of the userid to provision the resource to some related id of the user .I want to send this user ID from the process fo

  • Fiscal year-report

    1.HOw will compare different fiscal year variant for reporting prupose? 2. How will assigne the business area, and how will get u business areas wise report.

  • Scrollable bar in webdynpro java tables

    Hi All, Is it possible to have a vertical scroll bar in tables? i have used the scrollable container UI element,and increased the table row visiblity as 20 still i'm not getting the scroll bar. Can anybody help on this? Regards, V Karthi

  • Not able to Find  Some BOM Related  Standard Data Sources in  PP.

    Dear Gurus,      I am not able to find the Standard Data Sources for Loading the Master Data for the Following Standard Info Objects 1. 0BOM 2. 0COMPONENT 3. 0HG_LV_ITEM      I have activated the objects in BW side, but not able to find the data sour