Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 576
  • Last Modified:

cannot send email to groupwise using ASP

ok, here is the situation. im working on a "contact us" page for our intranet. The code was already there but i was asked to add an "add attachments" button. so i grabbed the code from the server and added code to upload (using asp upload) the file. I also changed the code accordingly to add the attachment in the email. for testing i used IIS in windows XP Pro. now here's the catch, it works for sending email w/ attachment to yahoo but when i send an email to groupwise 6.5, the mail gets stuck in C:\Inetpub\mailroot\Queue.

help!

here's the code. it works fine except when sending stuff to groupwise. fyi, a form passes value to this asp script.

<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #include file="upload.asp" -->
<%

'<---------------------------------------------------------------->
'Do all necessary declarations and initializations in this section:
'Begin declarations and initialization

Const cdoSendUsingPickup = 1

Dim Uploader, File, strName, strMsg, objMessage, cdoConfig, Flds

Set Uploader = New FileUploader
Set objMessage = Server.CreateObject("CDO.Message")
Set cdoConfig = Server.CreateObject("CDO.Configuration")
Set Flds = cdoConfig.Fields

With Flds
      .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPickup
           .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\Inetpub\mailroot\pickup"
           .Update
End With

Uploader.Upload()

strName = Uploader.Form("uname")
strMsg  = Uploader.Form("msg")

If strName = "" Then
      strName = "Comment from: Anonymous Employee"
Else
      strName = "Comment from: " & strName
End IF

'End declarations and initialization
'<---------------------------------------------------------------->


If Uploader.Files.Count = 0 Then
'Send email without attachment

      With objMessage
                      Set .Configuration = cdoConfig
                      .To = "to_me@dom.com"    
                      .From = "SDC Website <from_web@dom.com>"
                      .Subject = "Comments for the webmaster"
                      .TextBody = strName & vbCrLf & vbCrLf & strMsg & vbCrLf & vbCrLf      
                      .Send
           End With
     
Else
'Send email with attachment. Upload file in server first
'then add attachment in email, send and DELETE uploaded file

      Dim FSO
      Set FSO = Server.CreateObject("Scripting.FileSystemObject")

           For Each File In Uploader.Files.Items
      'Save to server, attach then delete

      '<----------------------Caution-------------------------------->
      'Change the path below before transferring to the server!
      'Maybe something like "C:\Inetpub\wwwroot\...\UploadedFiles
      '<------------------------------------------------------------->
   
                File.SaveToDisk "C:\Inetpub\wwwroot\Intranet\fileuploader"          


                 With objMessage
                      Set .Configuration = cdoConfig
                      .To = "to_me@dom.com"    
                      .From = "SDC Website <from web_master@dom.com>"
                      .Subject = "Comments for the webmaster"
                      .TextBody = strName & vbCrLf & vbCrLf & strMsg & vbCrLf & vbCrLf

                  '<----------------------Caution-------------------------------->
                       'Change the path below before transferring to the server!
                       'Maybe something like "C:\Inetpub\wwwroot\...\UploadedFiles
                       '<------------------------------------------------------------->    

                      .AddAttachment "C:\Inetpub\wwwroot\Intranet\fileuploader\" & File.FileName        
                      .Send
                 End With

            '<----------------------Caution-------------------------------->
                 'Change the path below before transferring to the server!
                 'Maybe something like "C:\Inetpub\wwwroot\...\UploadedFiles
                 '<------------------------------------------------------------->    

            If FSO.FileExists("C:\Inetpub\wwwroot\Intranet\fileuploader\" & File.FileName) Then
                  FSO.DeleteFile("C:\Inetpub\wwwroot\Intranet\fileuploader\" & File.FileName)
            End If

      Next

      'Release Memory!
      Set FSO = Nothing

End If


'Release memory!
Set objMessage = Nothing
Set cdoConfig = Nothing
Set Flds = Nothing

%>

maybe its because its not running in the actual server? does it matter? thank you so much!
0
msgolez
Asked:
msgolez
  • 6
  • 4
1 Solution
 
WMIFCommented:
will mail go through if you dont have an attachment?
0
 
msgolezAuthor Commented:
nope. mail wont go through with or without an attachment when sending to groupwise 6.5. but i can get it (with or without attachment) if i send it to my yahoo mail.

thanks
0
 
WMIFCommented:
you have smtp services installed on your web server and are using those to send the email out?  if so, you might try pointing your script to the groupwise server to relay it through.  you will probably need to enable relaying from this web server machine.  

what i imagine is happening, is that your groupwise server is doing a reverse lookup for the domain you are passing.  that domain points to a different ip address than the ip your web server has.  therefore its rejecting the mail.  by setting the script to relay through the groupwise server, it will then be able to distribute the emails to wherever accordingly.

lets try this though.  follow this link while signed onto your web server connecting to your groupwise server using this test.  most likely you will get a reject error when entering the from address.
http://www.amset.info/exchange/telnet-test.asp
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
msgolezAuthor Commented:
yes i have smtp installed in the machine thats running the script. and im not really sure how to implement what you just said. sorry i dont have a lot of server programming training. if you can maybe show me some sample code? and another thing that i noticed is the other guy's code (the base code that didnt implement the add attachment) works on the server but not on the test machine. as for the link, i cant really test it until monday since the network and domain is at work :P

anyway, i dont know if this matters but this is how i am setting this up. i guess more details wont really hurt. the script above is located in C:\inetpubbb\wwwdata\intranet. this test machine is just a regular pc in the office with win xp pro and iis installed. i test it by using another pc and typing in
<ip address of test machine>\intranet\webmaster.asp. webmaster.asp is just a regular asp that calls the above script sendmail.asp when submit is pressed.

but thank you so much for your insight, ill be sure to test this asap.
0
 
msgolezAuthor Commented:
webmaster.asp is of course the form with all the textboxes and buttons
0
 
WMIFCommented:
i am pretty confident that what i described in the second paragraph is what is happening.  take the weekend off and worry about this again on monday. :)  let me know how it goes.
0
 
msgolezAuthor Commented:
so sorry for triple posting. forgot to mention we also have a spam filter. the program is called gee-whiz and it filters all incoming email, however when i checked it today, my email were not there either. didnt know if that matters so i posted it anyway
0
 
msgolezAuthor Commented:
thanks dude! happy cinco de mayo! *parties*
0
 
msgolezAuthor Commented:
ok i transferred it to the server  and it *seems* to be working fine for now. give me some time to test it some more.
0
 
WMIFCommented:
sure thing.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now