Results 1 to 8 of 8

Thread: [02/03] problem with mail server when attempting to send mail

  1. #1

    Thread Starter
    Member frix199's Avatar
    Join Date
    Dec 2005
    Location
    Thessaloniki, Greece iamthebest: True
    Posts
    59

    Talking [02/03] problem with mail server when attempting to send mail

    ye ye its me again!
    ok heres the deal, im making a program that sends e-mails, with the code found @ this thread
    ok i got the code all runing and working, manually fixed some errors, ask if u want the source.
    my problem is that when i send the mail its send from a different e-mail address that it was ment to? xD
    it is send from the e-mail adres MS outlock has...
    any ideas? plx?

    bibi

    PS: post #50, i promise 2 be better (lol)


    Human beings are a disease, a cancer of this planet, you are a plague, and we are the cure.

  2. #2
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: [02/03] problem with mail server when attempting to send mail

    Post the code that you are using. Also what email address is it using? For example, is it using the address that you ment to use as the To address, or is it one that you have no idea where it is coming from?
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  3. #3

    Thread Starter
    Member frix199's Avatar
    Join Date
    Dec 2005
    Location
    Thessaloniki, Greece iamthebest: True
    Posts
    59

    Re: [02/03] problem with mail server when attempting to send mail

    hey m8
    VB Code:
    1. 'the import:
    2. Imports System.Web.Mail
    3.  
    4.  
    5.  
    6. 'here lol
    7.   Inherits System.Windows.Forms.Form
    8.  
    9.     ' Variable which will send the mail
    10.     Private obj As System.Web.Mail.SmtpMail
    11.  
    12.     'Variable to store the attachments
    13.     Private Attachment As System.Web.Mail.MailAttachment
    14.  
    15.     'Variable to create the message to send
    16.     Private Mailmsg As New System.Web.Mail.MailMessage
    17.  
    18.  
    19.  
    20. '@ the button sub:
    21. Dim Counter As Integer
    22.  
    23.         'Validate the data
    24.         If Txtsmtpserver.Text = "" Then
    25.             MsgBox("Enter the SMTP server info ...!!!", MsgBoxStyle.Information, "Send Email")
    26.             Exit Sub
    27.         End If
    28.  
    29.         If txtfromemail.Text = "" Then
    30.             MsgBox("Enter your Email address.", MsgBoxStyle.Information, "Send Email")
    31.             Exit Sub
    32.         End If
    33.  
    34.         If txtto.Text = "" Then
    35.             MsgBox("Enter the Recipient's Email address.", MsgBoxStyle.Information, "Send Email")
    36.             Exit Sub
    37.         End If
    38.  
    39.         If txtsubject.Text = "" Then
    40.             MsgBox("Please enter an e-mail subject.", MsgBoxStyle.Information, "Send Email")
    41.             Exit Sub
    42.         End If
    43.  
    44.         'Set the properties
    45.         'Assign the SMTP server
    46.         obj.SmtpServer = Txtsmtpserver.Text
    47.         'Multiple recepients can be specified using ; as the delimeter
    48.         'Address of the recipient
    49.         Mailmsg.To = txtto.Text
    50.  
    51.  
    52.         'Your From Address
    53.         'You can also use a custom header Reply-To for a different replyto address
    54.         'Mailmsg.From = "\" & txtFromName.Text & "\ <" & txtFromEmail.Text & ">"
    55.  
    56.  
    57.         'Specify the body format
    58.         If chkFormat.Checked = True Then
    59.             Mailmsg.BodyFormat = MailFormat.Html   'Send the mail in HTML Format
    60.         Else
    61.             Mailmsg.BodyFormat = MailFormat.Text
    62.         End If
    63.  
    64.         'If you want you can add a reply to header
    65.         'Mailmsg.Headers.Add("Reply-To", "[email protected]")
    66.         'custom headersare added like this
    67.         'Mailmsg.Headers.Add("Manoj", "TestHeader")
    68.  
    69.         'Mail Subject
    70.         Mailmsg.Subject = txtsubject.Text
    71.  
    72.         'Attach the files one by one
    73.         For Counter = 0 To lstAttachment.Items.Count - 1
    74.             Attachment = New MailAttachment(lstAttachment.Items(Counter))
    75.             'Add it to the mail message
    76.             Mailmsg.Attachments.Add(Attachment)
    77.         Next
    78.  
    79.         'Mail Body
    80.         Mailmsg.Body = txtmessage.Text
    81.         'Call the send method to send the mail
    82.         obj.Send(Mailmsg)

    ok it sends the e-mail from the address i send e-mails from outlock, from a site i got.
    i mean, when i send an e-mail from outlock, i send it from [email protected]
    so when i send an e-mail from the program writing as host ex: mail.tee.gr it still sends it as [email protected] from asbanda.mail.info
    thanx


    Human beings are a disease, a cancer of this planet, you are a plague, and we are the cure.

  4. #4
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: [02/03] problem with mail server when attempting to send mail

    I'm not quite getting what the issue is.
    The email is being sent from [email protected].
    But you want something different to be displayed in the from property?

    If that is correct, you aren't setting the From property of the email. It's commneted out right under where you are setting the To property. So if you uncomment
    VB Code:
    1. Mailmsg.From
    and set the from address it should appear to be sent from that email address (If I am understandign your issue correctly).
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  5. #5

    Thread Starter
    Member frix199's Avatar
    Join Date
    Dec 2005
    Location
    Thessaloniki, Greece iamthebest: True
    Posts
    59

    Re: [02/03] problem with mail server when attempting to send mail

    i mean, i set as the host i wanna the e-mail 2 b sent, mail.yahoo.gr, and the from as [email protected]
    but it sends an e-mail from mail.asbanda.info, from the e-mail [email protected]
    i set a server, but its sent fromm a different server, the one outlock gots to send e-mails
    sorry for my english


    Human beings are a disease, a cancer of this planet, you are a plague, and we are the cure.

  6. #6
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: [02/03] problem with mail server when attempting to send mail

    For one thing you can only send mail using Yahoo if you have their pay account. The free account doesn't supports pop and smtp.

    I don't have 02/03 installed on the system I am on, so I can't verify where this is, but if you do have the pay account with yahoo, you have to set the Username and password for that account to be able to send mail to it. In 2005 it's called netcredentials.
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  7. #7

    Thread Starter
    Member frix199's Avatar
    Join Date
    Dec 2005
    Location
    Thessaloniki, Greece iamthebest: True
    Posts
    59

    Re: [02/03] problem with mail server when attempting to send mail

    well, u may be right, but i used an external e-mail application, and sended an e-mail from mail.yahoo.gr while i have the free account... i dont know a lot for mailstuff, do u think it wasnt usind smtp?


    Human beings are a disease, a cancer of this planet, you are a plague, and we are the cure.

  8. #8
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: [02/03] problem with mail server when attempting to send mail

    I don't know how they did it.
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width